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
September 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
1030 discussions
Start a n
N
ew thread
Nikolay Sivov : ole32/composite: Store components as a pair of top level monikers.
by Alexandre Julliard
21 Sep '21
21 Sep '21
Module: wine Branch: master Commit: a767c6d6c61bb69749be615829bb4a1469b386bb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a767c6d6c61bb69749be6158…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Sep 21 15:05:08 2021 +0300 ole32/composite: Store components as a pair of top level monikers. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/compositemoniker.c | 966 +++++++++++++++++++++--------------------- dlls/ole32/tests/moniker.c | 48 ++- 2 files changed, 517 insertions(+), 497 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=a767c6d6c61bb69749be…
1
0
0
0
Nikolay Sivov : ole32/composite: Return requested interface in BindToObject() in NULL left moniker path.
by Alexandre Julliard
21 Sep '21
21 Sep '21
Module: wine Branch: master Commit: bbf0abdea5c8c8d3c77214fff995ef38077c902a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bbf0abdea5c8c8d3c77214ff…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Sep 21 15:05:07 2021 +0300 ole32/composite: Return requested interface in BindToObject() in NULL left moniker path. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/compositemoniker.c | 48 ++++++++++++++++++++----------------------- dlls/ole32/tests/moniker.c | 38 +++++++++++++++++++++++++++------- 2 files changed, 53 insertions(+), 33 deletions(-) diff --git a/dlls/ole32/compositemoniker.c b/dlls/ole32/compositemoniker.c index 5914008fe39..38a2e2a4892 100644 --- a/dlls/ole32/compositemoniker.c +++ b/dlls/ole32/compositemoniker.c @@ -323,37 +323,33 @@ CompositeMonikerImpl_GetSizeMax(IMoniker* iface,ULARGE_INTEGER* pcbSize) return S_OK; } -/****************************************************************************** - * CompositeMoniker_BindToObject - ******************************************************************************/ -static HRESULT WINAPI -CompositeMonikerImpl_BindToObject(IMoniker* iface, IBindCtx* pbc, - IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult) +static HRESULT WINAPI CompositeMonikerImpl_BindToObject(IMoniker *iface, IBindCtx *pbc, + IMoniker *pmkToLeft, REFIID riid, void **result) { - HRESULT res; - IRunningObjectTable *prot; + IRunningObjectTable *rot; + IUnknown *object; + HRESULT hr; IMoniker *tempMk,*antiMk,*rightMostMk; IEnumMoniker *enumMoniker; - TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvResult); + TRACE("(%p,%p,%p,%s,%p)\n", iface, pbc, pmkToLeft, debugstr_guid(riid), result); - if (ppvResult==NULL) + if (!result) return E_POINTER; - *ppvResult=0; - /* If pmkToLeft is NULL, this method looks for the moniker in the ROT, and if found, queries the retrieved */ - /* object for the requested interface pointer. */ - if(pmkToLeft==NULL){ - - res=IBindCtx_GetRunningObjectTable(pbc,&prot); + *result = NULL; - if (SUCCEEDED(res)){ - - /* if the requested class was loaded before ! we don't need to reload it */ - res = IRunningObjectTable_GetObject(prot,iface,(IUnknown**)ppvResult); + if (!pmkToLeft) + { + hr = IBindCtx_GetRunningObjectTable(pbc, &rot); + if (SUCCEEDED(hr)) + { + hr = IRunningObjectTable_GetObject(rot, iface, &object); + IRunningObjectTable_Release(rot); + if (FAILED(hr)) return E_INVALIDARG; - if (res==S_OK) - return res; + hr = IUnknown_QueryInterface(object, riid, result); + IUnknown_Release(object); } } else{ @@ -364,17 +360,17 @@ CompositeMonikerImpl_BindToObject(IMoniker* iface, IBindCtx* pbc, IEnumMoniker_Next(enumMoniker,1,&rightMostMk,NULL); IEnumMoniker_Release(enumMoniker); - res=CreateAntiMoniker(&antiMk); - res=IMoniker_ComposeWith(iface,antiMk,0,&tempMk); + hr = CreateAntiMoniker(&antiMk); + hr = IMoniker_ComposeWith(iface,antiMk,0,&tempMk); IMoniker_Release(antiMk); - res=IMoniker_BindToObject(rightMostMk,pbc,tempMk,riid,ppvResult); + hr = IMoniker_BindToObject(rightMostMk,pbc,tempMk,riid,result); IMoniker_Release(tempMk); IMoniker_Release(rightMostMk); } - return res; + return hr; } /****************************************************************************** diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index b584f370d70..d65535a0584 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -2906,8 +2906,9 @@ static void test_generic_composite_moniker(void) { IMoniker *moniker, *inverse, *inverse2, *moniker1, *moniker2, *moniker3, *moniker4; IEnumMoniker *enummoniker; + IRunningObjectTable *rot; + DWORD hash, cookie; HRESULT hr; - DWORD hash; IBindCtx *bindctx; FILETIME filetime; IUnknown *unknown; @@ -3032,15 +3033,9 @@ todo_wine hr = IMoniker_GetTimeOfLastChange(moniker, bindctx, NULL, &filetime); ok(hr == MK_E_NOTBINDABLE, "IMoniker_GetTimeOfLastChange should return MK_E_NOTBINDABLE, not 0x%08x\n", hr); - hr = IMoniker_BindToObject(moniker, bindctx, NULL, &IID_IUnknown, (void **)&unknown); - todo_wine - ok(hr == E_INVALIDARG, "IMoniker_BindToObject should return E_INVALIDARG, not 0x%08x\n", hr); - hr = IMoniker_BindToStorage(moniker, bindctx, NULL, &IID_IUnknown, (void **)&unknown); ok(hr == E_INVALIDARG, "IMoniker_BindToStorage should return E_INVALIDARG, not 0x%08x\n", hr); - IBindCtx_Release(bindctx); - hr = IMoniker_Inverse(moniker, &inverse); ok(hr == S_OK, "Failed to get inverse, hr %#x.\n", hr); TEST_MONIKER_TYPE(inverse, MKSYS_GENERICCOMPOSITE); @@ -3059,7 +3054,36 @@ todo_wine todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + /* BindToObject() */ + hr = IMoniker_BindToObject(moniker, bindctx, NULL, &IID_IUnknown, (void **)&unknown); + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + + hr = IBindCtx_GetRunningObjectTable(bindctx, &rot); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + hr = IRunningObjectTable_Register(rot, ROTFLAGS_REGISTRATIONKEEPSALIVE, (IUnknown *)moniker, + moniker, &cookie); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + hr = IMoniker_BindToObject(moniker, bindctx, NULL, &IID_IUnknown, (void **)&unknown); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IUnknown_Release(unknown); + + hr = IMoniker_BindToObject(moniker, bindctx, NULL, &IID_IMoniker, (void **)&unknown); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IUnknown_Release(unknown); + + hr = IMoniker_BindToObject(moniker, bindctx, NULL, &IID_IDispatch, (void **)&unknown); + ok(hr == E_NOINTERFACE, "Unexpected hr %#x.\n", hr); + + hr = IRunningObjectTable_Revoke(rot, cookie); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + IRunningObjectTable_Release(rot); + IMoniker_Release(moniker); + + IBindCtx_Release(bindctx); } static void test_pointer_moniker(void)
1
0
0
0
Jacek Caban : gdi32: Remove workaround for old freetype versions.
by Alexandre Julliard
21 Sep '21
21 Sep '21
Module: wine Branch: master Commit: 862ae1a634cbf49f54622050b9bc60c95f019065 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=862ae1a634cbf49f54622050…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Sep 21 15:54:36 2021 +0200 gdi32: Remove workaround for old freetype versions. 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/gdi32/font.c | 53 ++--------------------------------------------------- 1 file changed, 2 insertions(+), 51 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index f916ed97f01..11cec6b95ae 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -5554,24 +5554,6 @@ DWORD WINAPI NtGdiGetGlyphIndicesW( HDC hdc, const WCHAR *str, INT count, * * ***********************************************************************/ -static BOOL CALLBACK load_enumed_resource(HMODULE hModule, LPCWSTR type, LPWSTR name, LONG_PTR lParam) -{ - HRSRC rsrc = FindResourceW(hModule, name, type); - HGLOBAL hMem = LoadResource(hModule, rsrc); - LPVOID *pMem = LockResource(hMem); - int *num_total = (int *)lParam; - DWORD num_in_res; - - TRACE("Found resource %s - trying to load\n", wine_dbgstr_w(type)); - if (!NtGdiAddFontMemResourceEx( pMem, SizeofResource(hModule, rsrc), NULL, 0, &num_in_res )) - { - ERR("Failed to load PE font resource mod=%p ptr=%p\n", hModule, hMem); - return FALSE; - } - - *num_total += num_in_res; - return TRUE; -} static int add_system_font_resource( const WCHAR *file, DWORD flags ) { @@ -5949,26 +5931,8 @@ void font_init(void) INT WINAPI NtGdiAddFontResourceW( const WCHAR *str, ULONG size, ULONG files, DWORD flags, DWORD tid, void *dv ) { - int ret; - if (!font_funcs) return 1; - if (!(ret = add_font_resource( str, flags ))) - { - /* FreeType <2.3.5 has problems reading resources wrapped in PE files. */ - HMODULE hModule = LoadLibraryExW(str, NULL, LOAD_LIBRARY_AS_DATAFILE); - if (hModule != NULL) - { - int num_resources = 0; - LPWSTR rt_font = (LPWSTR)((ULONG_PTR)8); /* we don't want to include winuser.h */ - - TRACE("WineEngAddFontResourceEx failed on PE file %s - trying to load resources manually\n", - wine_dbgstr_w(str)); - if (EnumResourceNamesW(hModule, rt_font, load_enumed_resource, (LONG_PTR)&num_resources)) - ret = num_resources; - FreeLibrary(hModule); - } - } - return ret; + return add_font_resource( str, flags ); } /*********************************************************************** @@ -6035,21 +5999,8 @@ BOOL WINAPI NtGdiRemoveFontMemResourceEx( HANDLE handle ) BOOL WINAPI NtGdiRemoveFontResourceW( const WCHAR *str, ULONG size, ULONG files, DWORD flags, DWORD tid, void *dv ) { - int ret; - if (!font_funcs) return TRUE; - - if (!(ret = remove_font_resource( str, flags ))) - { - /* FreeType <2.3.5 has problems reading resources wrapped in PE files. */ - HMODULE hModule = LoadLibraryExW(str, NULL, LOAD_LIBRARY_AS_DATAFILE); - if (hModule != NULL) - { - WARN("Can't unload resources from PE file %s\n", wine_dbgstr_w(str)); - FreeLibrary(hModule); - } - } - return ret; + return remove_font_resource( str, flags ); } /***********************************************************************
1
0
0
0
Jacek Caban : gdi32: Directly use ntdll for font mutex.
by Alexandre Julliard
21 Sep '21
21 Sep '21
Module: wine Branch: master Commit: 57767a9af85d6d9759eb458b0d3695901ee50a0f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=57767a9af85d6d9759eb458b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Sep 21 15:54:17 2021 +0200 gdi32: Directly use ntdll for font mutex. 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/gdi32/font.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index e5e294435e9..f916ed97f01 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -5889,9 +5889,15 @@ static const struct font_callback_funcs callback_funcs = { add_gdi_face }; */ void font_init(void) { + OBJECT_ATTRIBUTES attr = { sizeof(attr) }; + UNICODE_STRING name; HANDLE mutex; DWORD disposition; + static WCHAR wine_font_mutexW[] = + {'\\','B','a','s','e','N','a','m','e','d','O','b','j','e','c','t','s', + '\\','_','_','W','I','N','E','_','F','O','N','T','_','M','U','T','E','X','_','_'}; + if (RegCreateKeyExW( HKEY_CURRENT_USER, L"Software\\Wine\\Fonts", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &wine_fonts_key, NULL )) return; @@ -5904,8 +5910,13 @@ void font_init(void) load_file_system_fonts(); font_funcs->load_fonts(); - if (!(mutex = CreateMutexW( NULL, FALSE, L"__WINE_FONT_MUTEX__" ))) return; - WaitForSingleObject( mutex, INFINITE ); + attr.Attributes = OBJ_OPENIF; + attr.ObjectName = &name; + name.Buffer = wine_font_mutexW; + name.Length = name.MaximumLength = sizeof(wine_font_mutexW); + + if (NtCreateMutant( &mutex, MUTEX_ALL_ACCESS, &attr, FALSE ) < 0) return; + NtWaitForSingleObject( mutex, FALSE, NULL ); RegCreateKeyExW( wine_fonts_key, L"Cache", 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &wine_fonts_cache_key, &disposition ); @@ -5916,7 +5927,7 @@ void font_init(void) update_external_font_keys(); } - ReleaseMutex( mutex ); + NtReleaseMutant( mutex, NULL ); if (disposition != REG_CREATED_NEW_KEY) {
1
0
0
0
Jacek Caban : gdi32: Directly use ntdll in load_directory_fonts.
by Alexandre Julliard
21 Sep '21
21 Sep '21
Module: wine Branch: master Commit: ce244d7523e976adf1f621c31d29c4572501e9cb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ce244d7523e976adf1f621c3…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Sep 21 15:54:12 2021 +0200 gdi32: Directly use ntdll in load_directory_fonts. 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/gdi32/font.c | 66 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index a0da2a385ca..e5e294435e9 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -420,13 +420,13 @@ static void get_fonts_data_dir_path( const WCHAR *file, WCHAR *path ) else if (GetEnvironmentVariableW( L"WINEBUILDDIR", path, MAX_PATH )) lstrcatW( path, L"\\fonts\\" ); - lstrcatW( path, file ); + if (file) lstrcatW( path, file ); } static void get_fonts_win_dir_path( const WCHAR *file, WCHAR *path ) { lstrcpyW( path, L"\\??\\C:\\windows\\fonts\\" ); - lstrcatW( path, file ); + if (file) lstrcatW( path, file ); } /* font substitutions */ @@ -5663,21 +5663,52 @@ static void load_system_bitmap_fonts(void) static void load_directory_fonts( WCHAR *path, UINT flags ) { + OBJECT_ATTRIBUTES attr; + UNICODE_STRING nt_name; + IO_STATUS_BLOCK io; HANDLE handle; - WIN32_FIND_DATAW data; - WCHAR *p; + char buf[8192]; + size_t len; - p = path + lstrlenW(path) - 1; - TRACE( "loading fonts from %s\n", debugstr_w(path) ); - handle = FindFirstFileW( path, &data ); - if (handle == INVALID_HANDLE_VALUE) return; - do + len = lstrlenW( path ); + while (len && path[len - 1] == '\\') len--; + + nt_name.Buffer = path; + nt_name.MaximumLength = nt_name.Length = len * sizeof(WCHAR); + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.ObjectName = &nt_name; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + if (NtOpenFile( &handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, + FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_FOR_BACKUP_INTENT )) + return; + + path[len++] = '\\'; + + while (!NtQueryDirectoryFile( handle, 0, NULL, NULL, &io, buf, sizeof(buf), + FileBothDirectoryInformation, FALSE, NULL, FALSE ) && + io.Information) { - if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; - lstrcpyW( p, data.cFileName ); - font_funcs->add_font( path, flags ); - } while (FindNextFileW( handle, &data )); - FindClose( handle ); + FILE_BOTH_DIR_INFORMATION *info = (FILE_BOTH_DIR_INFORMATION *)buf; + for (;;) + { + if (!(info->FileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + { + memcpy( path + len, info->FileName, info->FileNameLength ); + path[len + info->FileNameLength / sizeof(WCHAR)] = 0; + font_funcs->add_font( path, flags ); + } + if (!info->NextEntryOffset) break; + info = (FILE_BOTH_DIR_INFORMATION *)((char *)info + info->NextEntryOffset); + } + } + + NtClose( handle ); } static void load_file_system_fonts(void) @@ -5686,11 +5717,11 @@ static void load_file_system_fonts(void) DWORD len = sizeof(value); /* Windows directory */ - get_fonts_win_dir_path( L"*", path ); + get_fonts_win_dir_path( NULL, path ); load_directory_fonts( path, 0 ); /* Wine data directory */ - get_fonts_data_dir_path( L"*", path ); + get_fonts_data_dir_path( NULL, path ); load_directory_fonts( path, ADDFONT_EXTERNAL_FONT ); /* custom paths */ @@ -5701,8 +5732,7 @@ static void load_file_system_fonts(void) { if ((next = wcschr( ptr, ';' ))) *next++ = 0; if (next && next - ptr < 2) continue; - lstrcpynW( path, ptr, MAX_PATH - 2 ); - lstrcatW( path, L"\\*" ); + lstrcpynW( path, ptr, MAX_PATH ); if (path[1] == ':') { memmove( path + ARRAYSIZE(nt_prefixW), path, (lstrlenW( path ) + 1) * sizeof(WCHAR) );
1
0
0
0
Jacek Caban : gdi32: Use NtQueryFullAttributesFile directly in alloc_gdi_font.
by Alexandre Julliard
21 Sep '21
21 Sep '21
Module: wine Branch: master Commit: b4abe2010b90333bc00ef32245c5b3f235012d77 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b4abe2010b90333bc00ef322…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Sep 21 15:54:04 2021 +0200 gdi32: Use NtQueryFullAttributesFile directly in alloc_gdi_font. 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/gdi32/font.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index acf281abcea..a0da2a385ca 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -1713,11 +1713,25 @@ static struct gdi_font *alloc_gdi_font( const WCHAR *file, void *data_ptr, SIZE_ if (file) { - WIN32_FILE_ATTRIBUTE_DATA info; - if (GetFileAttributesExW( file, GetFileExInfoStandard, &info )) + FILE_NETWORK_OPEN_INFORMATION info; + UNICODE_STRING nt_name; + OBJECT_ATTRIBUTES attr; + + nt_name.Buffer = (WCHAR *)file; + nt_name.Length = nt_name.MaximumLength = len * sizeof(WCHAR); + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.ObjectName = &nt_name; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + if (!NtQueryFullAttributesFile( &attr, &info )) { - font->writetime = info.ftLastWriteTime; - font->data_size = (LONGLONG)info.nFileSizeHigh << 32 | info.nFileSizeLow; + font->writetime.dwLowDateTime = info.LastWriteTime.LowPart; + font->writetime.dwHighDateTime = info.LastWriteTime.HighPart; + font->data_size = info.EndOfFile.QuadPart; memcpy( font->file, file, len * sizeof(WCHAR) ); } }
1
0
0
0
Jacek Caban : gdi32: Store NT paths in font structs.
by Alexandre Julliard
21 Sep '21
21 Sep '21
Module: wine Branch: master Commit: 5b57e4cca9be526597e9e8ec5a776a117e6c7ba9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5b57e4cca9be526597e9e8ec…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Sep 21 15:53:57 2021 +0200 gdi32: Store NT paths in font structs. 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/gdi32/font.c | 78 +++++++++++++++++++++++++++++---------------------- dlls/gdi32/freetype.c | 7 ----- 2 files changed, 44 insertions(+), 41 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 62b0c9cdec4..acf281abcea 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -89,6 +89,8 @@ static const struct font_backend_funcs *font_funcs; static const MAT2 identity = { {0,1}, {0,0}, {0,0}, {0,1} }; +static const WCHAR nt_prefixW[] = {'\\','?','?','\\'}; + static UINT font_smoothing = GGO_BITMAP; static UINT subpixel_orientation = GGO_GRAY4_BITMAP; static BOOL antialias_fakes = TRUE; @@ -419,14 +421,11 @@ static void get_fonts_data_dir_path( const WCHAR *file, WCHAR *path ) lstrcatW( path, L"\\fonts\\" ); lstrcatW( path, file ); - if (path[5] == ':') memmove( path, path + 4, (lstrlenW(path) - 3) * sizeof(WCHAR) ); - else path[1] = '\\'; /* change \??\ to \\?\ */ } static void get_fonts_win_dir_path( const WCHAR *file, WCHAR *path ) { - GetWindowsDirectoryW( path, MAX_PATH ); - lstrcatW( path, L"\\fonts\\" ); + lstrcpyW( path, L"\\??\\C:\\windows\\fonts\\" ); lstrcatW( path, file ); } @@ -5446,7 +5445,6 @@ BOOL get_file_outline_text_metric( const WCHAR *path, OUTLINETEXTMETRICW *otm ) if (!path || !font_funcs) return FALSE; - if (*path == '\\') path += 4; /* skip NT prefix */ if (!(font = alloc_gdi_font( path, NULL, 0 ))) goto done; font->lf.lfHeight = 100; if (!font_funcs->load_font( font )) goto done; @@ -5598,21 +5596,18 @@ static BOOL remove_system_font_resource( LPCWSTR file, DWORD flags ) static int add_font_resource( LPCWSTR file, DWORD flags ) { - WCHAR path[MAX_PATH]; int ret = 0; - if (*file == '\\') file += 4; /* skip NT prefix */ - if (GetFullPathNameW( file, MAX_PATH, path, NULL )) + if (*file == '\\') { DWORD addfont_flags = ADDFONT_ALLOW_BITMAP | ADDFONT_ADD_RESOURCE; if (!(flags & FR_PRIVATE)) addfont_flags |= ADDFONT_ADD_TO_CACHE; EnterCriticalSection( &font_cs ); - ret = font_funcs->add_font( path, addfont_flags ); + ret = font_funcs->add_font( file, addfont_flags ); LeaveCriticalSection( &font_cs ); } - - if (!ret && !wcschr( file, '\\' )) + else if (!wcschr( file, '\\' )) ret = add_system_font_resource( file, ADDFONT_ALLOW_BITMAP | ADDFONT_ADD_RESOURCE ); return ret; @@ -5620,19 +5615,16 @@ static int add_font_resource( LPCWSTR file, DWORD flags ) static BOOL remove_font_resource( LPCWSTR file, DWORD flags ) { - WCHAR path[MAX_PATH]; BOOL ret = FALSE; - if (*file == '\\') file += 4; /* skip NT prefix */ - if (GetFullPathNameW( file, MAX_PATH, path, NULL )) + if (*file == '\\') { DWORD addfont_flags = ADDFONT_ALLOW_BITMAP | ADDFONT_ADD_RESOURCE; if (!(flags & FR_PRIVATE)) addfont_flags |= ADDFONT_ADD_TO_CACHE; - ret = remove_font( path, addfont_flags ); + ret = remove_font( file, addfont_flags ); } - - if (!ret && !wcschr( file, '\\' )) + else if (!wcschr( file, '\\' )) ret = remove_system_font_resource( file, ADDFONT_ALLOW_BITMAP | ADDFONT_ADD_RESOURCE ); return ret; @@ -5676,8 +5668,8 @@ static void load_directory_fonts( WCHAR *path, UINT flags ) static void load_file_system_fonts(void) { - WCHAR *ptr, *next, path[MAX_PATH], value[1024]; - DWORD len = ARRAY_SIZE(value); + WCHAR *ptr, *next, path[MAX_PATH + ARRAYSIZE(nt_prefixW)], value[1024]; + DWORD len = sizeof(value); /* Windows directory */ get_fonts_win_dir_path( L"*", path ); @@ -5697,6 +5689,11 @@ static void load_file_system_fonts(void) if (next && next - ptr < 2) continue; lstrcpynW( path, ptr, MAX_PATH - 2 ); lstrcatW( path, L"\\*" ); + if (path[1] == ':') + { + memmove( path + ARRAYSIZE(nt_prefixW), path, (lstrlenW( path ) + 1) * sizeof(WCHAR) ); + memcpy( path, nt_prefixW, sizeof(nt_prefixW) ); + } load_directory_fonts( path, ADDFONT_EXTERNAL_FONT ); } } @@ -5716,7 +5713,7 @@ static void update_external_font_keys(void) struct external_key *key, *next; struct gdi_font_face *face; DWORD len, i = 0, type, dlen, vlen; - WCHAR value[LF_FULLFACESIZE + 12], path[MAX_PATH], *tmp; + WCHAR value[LF_FULLFACESIZE + 12], path[MAX_PATH + 4], *tmp; WCHAR *file; HKEY hkey; @@ -5729,13 +5726,15 @@ static void update_external_font_keys(void) if (RegCreateKeyW( wine_fonts_key, L"External Fonts", &hkey )) return; + memcpy( path, nt_prefixW, sizeof(nt_prefixW) ); vlen = ARRAY_SIZE(value); - dlen = sizeof(path); - while (!RegEnumValueW( hkey, i++, value, &vlen, NULL, &type, (BYTE *)path, &dlen )) + dlen = sizeof(path) - sizeof(nt_prefixW); + while (!RegEnumValueW( hkey, i++, value, &vlen, NULL, &type, (BYTE *)path + sizeof(nt_prefixW), &dlen )) { if (type != REG_SZ) goto next; if ((tmp = wcsrchr( value, ' ' )) && !facename_compare( tmp, L" (TrueType)", -1 )) *tmp = 0; - if ((face = find_face_from_full_name( value )) && !wcsicmp( face->file, path )) + if ((face = find_face_from_full_name( value )) && + !wcsicmp( face->file, path[5] == ':' ? path : path + ARRAYSIZE(nt_prefixW) )) { face->flags |= ADDFONT_EXTERNAL_FOUND; goto next; @@ -5746,7 +5745,7 @@ static void update_external_font_keys(void) list_add_tail( &external_keys, &key->entry ); next: vlen = ARRAY_SIZE(value); - dlen = sizeof(path); + dlen = sizeof(path) - sizeof(nt_prefixW); } WINE_RB_FOR_EACH_ENTRY( family, &family_name_tree, struct gdi_font_family, name_entry ) @@ -5759,8 +5758,11 @@ static void update_external_font_keys(void) lstrcpyW( value, face->full_name ); if (face->scalable) lstrcatW( value, L" (TrueType)" ); - if (GetFullPathNameW( face->file, MAX_PATH, path, NULL )) - file = path; + if (face->file[0] == '\\') + { + file = face->file; + if (file[5] == ':') file += ARRAYSIZE(nt_prefixW); + } else if ((file = wcsrchr( face->file, '\\' ))) file++; else @@ -5787,7 +5789,7 @@ static void update_external_font_keys(void) static void load_registry_fonts(void) { - WCHAR value[LF_FULLFACESIZE + 12], data[MAX_PATH], *tmp; + WCHAR value[LF_FULLFACESIZE + 12], data[MAX_PATH + 4], *tmp, *path; DWORD i = 0, type, dlen, vlen; HKEY hkey; @@ -5800,8 +5802,9 @@ static void load_registry_fonts(void) L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts", &hkey )) return; + memcpy( data, nt_prefixW, sizeof(nt_prefixW) ); vlen = ARRAY_SIZE(value); - dlen = sizeof(data); + dlen = sizeof(data) - sizeof(nt_prefixW); while (!RegEnumValueW( hkey, i++, value, &vlen, NULL, &type, NULL, NULL )) { if (type != REG_SZ) goto next; @@ -5810,20 +5813,27 @@ static void load_registry_fonts(void) if (find_face_from_full_name( value )) goto next; if (tmp && !*tmp) *tmp = ' '; - if (RegQueryValueExW( hkey, value, NULL, NULL, (LPBYTE)data, &dlen )) + path = data + ARRAYSIZE(nt_prefixW); + if (RegQueryValueExW( hkey, value, NULL, NULL, (LPBYTE)data + sizeof(nt_prefixW), &dlen )) { WARN( "Unable to get face path %s\n", debugstr_w(value) ); goto next; } + if (path[0] && path[1] == ':') + { + path = data; + dlen += sizeof(nt_prefixW); + } + dlen /= sizeof(WCHAR); - if (data[0] && data[1] == ':') - add_font_resource( data, ADDFONT_ALLOW_BITMAP ); - else if (dlen >= 6 && !wcsicmp( data + dlen - 5, L".fon" )) - add_system_font_resource( data, ADDFONT_ALLOW_BITMAP ); + if (*path == '\\') + add_font_resource( path, ADDFONT_ALLOW_BITMAP ); + else if (dlen >= 6 && !wcsicmp( path + dlen - 5, L".fon" )) + add_system_font_resource( path, ADDFONT_ALLOW_BITMAP ); next: vlen = ARRAY_SIZE(value); - dlen = sizeof(data); + dlen = sizeof(data) - sizeof(nt_prefixW); } RegCloseKey( hkey ); } diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 54af7562321..2ce1ad58bb8 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -1361,13 +1361,6 @@ static WCHAR *get_dos_file_name( LPCSTR str ) RtlFreeHeap( GetProcessHeap(), 0, buffer ); return NULL; } - if (buffer[5] == ':') - { - /* get rid of the \??\ prefix */ - /* FIXME: should implement RtlNtPathNameToDosPathName and use that instead */ - memmove( buffer, buffer + 4, (len - 4) * sizeof(WCHAR) ); - } - else buffer[1] = '\\'; return buffer; }
1
0
0
0
Jacek Caban : gdi32: Pass NT paths to ntgdi functions.
by Alexandre Julliard
21 Sep '21
21 Sep '21
Module: wine Branch: master Commit: b7d0bab57cf2e7feb88bc68f83c6e24cc68e7d0b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b7d0bab57cf2e7feb88bc68f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Sep 21 15:53:49 2021 +0200 gdi32: Pass NT paths to ntgdi functions. 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/gdi32/font.c | 3 +++ dlls/gdi32/text.c | 51 +++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 07b4d248261..62b0c9cdec4 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -5446,6 +5446,7 @@ BOOL get_file_outline_text_metric( const WCHAR *path, OUTLINETEXTMETRICW *otm ) if (!path || !font_funcs) return FALSE; + if (*path == '\\') path += 4; /* skip NT prefix */ if (!(font = alloc_gdi_font( path, NULL, 0 ))) goto done; font->lf.lfHeight = 100; if (!font_funcs->load_font( font )) goto done; @@ -5600,6 +5601,7 @@ static int add_font_resource( LPCWSTR file, DWORD flags ) WCHAR path[MAX_PATH]; int ret = 0; + if (*file == '\\') file += 4; /* skip NT prefix */ if (GetFullPathNameW( file, MAX_PATH, path, NULL )) { DWORD addfont_flags = ADDFONT_ALLOW_BITMAP | ADDFONT_ADD_RESOURCE; @@ -5621,6 +5623,7 @@ static BOOL remove_font_resource( LPCWSTR file, DWORD flags ) WCHAR path[MAX_PATH]; BOOL ret = FALSE; + if (*file == '\\') file += 4; /* skip NT prefix */ if (GetFullPathNameW( file, MAX_PATH, path, NULL )) { DWORD addfont_flags = ADDFONT_ALLOW_BITMAP | ADDFONT_ADD_RESOURCE; diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index 41333903c0c..91d8facbccf 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -2385,6 +2385,23 @@ fail: return name; } +static int add_font_resource( const WCHAR *str, DWORD flags, void *dv ) +{ + UNICODE_STRING nt_name; + int ret; + + if (!RtlDosPathNameToNtPathName_U( str, &nt_name, NULL, NULL )) return 0; + ret = NtGdiAddFontResourceW( nt_name.Buffer, nt_name.Length / sizeof(WCHAR) + 1, + 1, flags, 0, dv ); + RtlFreeUnicodeString( &nt_name ); + if (!ret && !wcschr( str, '\\' )) + { + /* try as system font */ + ret = NtGdiAddFontResourceW( str, lstrlenW( str ) + 1, 1, flags, 0, dv ); + } + return ret; +} + /*********************************************************************** * AddFontResourceExW (GDI32.@) */ @@ -2394,15 +2411,32 @@ INT WINAPI AddFontResourceExW( const WCHAR *str, DWORD flags, void *dv ) BOOL hidden; INT ret; - if ((ret = NtGdiAddFontResourceW( str, 0, 1, flags, 0, dv ))) return ret; + if ((ret = add_font_resource( str, flags, dv ))) return ret; if (!(filename = get_scalable_filename( str, &hidden ))) return 0; if (hidden) flags |= FR_PRIVATE | FR_NOT_ENUM; - ret = NtGdiAddFontResourceW( filename, 0, 1, flags, 0, dv ); + ret = add_font_resource( filename, flags, dv ); HeapFree( GetProcessHeap(), 0, filename ); return ret; } +static int remove_font_resource( const WCHAR *str, DWORD flags, void *dv ) +{ + UNICODE_STRING nt_name; + int ret; + + if (!RtlDosPathNameToNtPathName_U( str, &nt_name, NULL, NULL )) return 0; + ret = NtGdiRemoveFontResourceW( nt_name.Buffer, nt_name.Length / sizeof(WCHAR) + 1, + 1, flags, 0, dv ); + RtlFreeUnicodeString( &nt_name ); + if (!ret && !wcschr( str, '\\' )) + { + /* try as system font */ + ret = NtGdiRemoveFontResourceW( str, lstrlenW( str ) + 1, 1, flags, 0, dv ); + } + return ret; +} + /*********************************************************************** * RemoveFontResourceExW (GDI32.@) */ @@ -2412,11 +2446,11 @@ BOOL WINAPI RemoveFontResourceExW( const WCHAR *str, DWORD flags, void *dv ) BOOL hidden; INT ret; - if ((ret = NtGdiRemoveFontResourceW( str, 0, 1, flags, 0, dv ))) return ret; + if ((ret = remove_font_resource( str, flags, dv ))) return ret; if (!(filename = get_scalable_filename( str, &hidden ))) return 0; if (hidden) flags |= FR_PRIVATE | FR_NOT_ENUM; - ret = NtGdiRemoveFontResourceW( filename, 0, 1, flags, 0, dv ); + ret = remove_font_resource( filename, flags, dv ); HeapFree( GetProcessHeap(), 0, filename ); return ret; } @@ -2629,8 +2663,10 @@ BOOL WINAPI CreateScalableFontResourceW( DWORD hidden, const WCHAR *resource_fil const WCHAR *font_file, const WCHAR *font_path ) { struct fontdir fontdir = { 0 }; + UNICODE_STRING nt_name; OUTLINETEXTMETRICW otm; WCHAR path[MAX_PATH]; + BOOL ret; TRACE("(%d, %s, %s, %s)\n", hidden, debugstr_w(resource_file), debugstr_w(font_file), debugstr_w(font_path) ); @@ -2643,9 +2679,12 @@ BOOL WINAPI CreateScalableFontResourceW( DWORD hidden, const WCHAR *resource_fil lstrcpynW( path, font_path, MAX_PATH ); lstrcatW( path, L"\\" ); lstrcatW( path, font_file ); + if (!RtlDosPathNameToNtPathName_U( path, &nt_name, NULL, NULL )) goto done; } - else if (!GetFullPathNameW( font_file, MAX_PATH, path, NULL )) goto done; - if (!get_file_outline_text_metric( path, &otm )) goto done; + else if (!RtlDosPathNameToNtPathName_U( font_file, &nt_name, NULL, NULL )) goto done; + ret = get_file_outline_text_metric( nt_name.Buffer, &otm ); + RtlFreeUnicodeString( &nt_name ); + if (!ret) goto done; if (!(otm.otmTextMetrics.tmPitchAndFamily & TMPF_TRUETYPE)) goto done; fontdir.num_of_resources = 1;
1
0
0
0
Alexandre Julliard : makefiles: Explicitly name the Unix library in the makefile instead of using --subsystem unixlib.
by Alexandre Julliard
21 Sep '21
21 Sep '21
Module: wine Branch: master Commit: ab5664a5e627731084f877626b251196a8aa726c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ab5664a5e627731084f87762…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Sep 21 14:42:02 2021 +0200 makefiles: Explicitly name the Unix library in the makefile instead of using --subsystem unixlib. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/avicap32/Makefile.in | 2 +- dlls/msv1_0/Makefile.in | 2 +- dlls/netapi32/Makefile.in | 2 +- dlls/ntdll/Makefile.in | 3 ++- dlls/odbc32/Makefile.in | 2 +- dlls/win32u/Makefile.in | 2 +- dlls/winebus.sys/Makefile.in | 3 ++- dlls/winepulse.drv/Makefile.in | 3 ++- dlls/ws2_32/Makefile.in | 3 ++- tools/makedep.c | 32 ++++++++++++++++---------------- tools/winegcc/winegcc.c | 23 +++++------------------ 11 files changed, 34 insertions(+), 43 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=ab5664a5e627731084f8…
1
0
0
0
Alexandre Julliard : makefiles: Normalize the host architecture in makedep instead of configure.
by Alexandre Julliard
21 Sep '21
21 Sep '21
Module: wine Branch: master Commit: 0f83b83cd526c1c411ab74e8f1a76423ba0a6291 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0f83b83cd526c1c411ab74e8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Sep 21 14:26:38 2021 +0200 makefiles: Normalize the host architecture in makedep instead of configure. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- Makefile.in | 2 +- configure | 14 -------------- configure.ac | 9 --------- tools/makedep.c | 34 +++++++++++++++++++++++++++++----- 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/Makefile.in b/Makefile.in index d9e01a277c0..74e9f96657f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -31,8 +31,8 @@ fontdir = ${datadir}/wine/fonts nlsdir = ${datadir}/wine/nls dlldir = ${libdir}/wine srcdir = @srcdir@ +host_cpu = @host_cpu@ SHELL = /bin/sh -ARCH = @ARCH@ CC = @CC@ CXX = @CXX@ CPPBIN = @CPPBIN@ diff --git a/configure b/configure index db592f0868d..70c4766de81 100755 --- a/configure +++ b/configure @@ -774,7 +774,6 @@ AR BISON FLEX TOOLSDIR -ARCH TARGETFLAGS LD CPPBIN @@ -5896,19 +5895,6 @@ then --enable-win64 should be used in the 64-bit build tree, --with-wine64 in the 32-bit Wow64 build tree." "$LINENO" 5 fi -case $host_cpu in - *i[3456789]86*) ARCH="i386" - ;; - *x86_64*) ARCH="x86_64" - ;; - *aarch64*) ARCH="aarch64" - ;; - *arm*) ARCH="arm" - ;; - *) ARCH="" - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the directory containing the Wine tools" >&5 $as_echo_n "checking for the directory containing the Wine tools... " >&6; } if ${wine_cv_toolsdir+:} false; then : diff --git a/configure.ac b/configure.ac index 0bc46a1427b..5db5b317da6 100644 --- a/configure.ac +++ b/configure.ac @@ -243,15 +243,6 @@ then --enable-win64 should be used in the 64-bit build tree, --with-wine64 in the 32-bit Wow64 build tree.]) fi -dnl Normalize CPU architecture -case $host_cpu in - *i[[3456789]]86*) AC_SUBST(ARCH,"i386") ;; - *x86_64*) AC_SUBST(ARCH,"x86_64") ;; - *aarch64*) AC_SUBST(ARCH,"aarch64") ;; - *arm*) AC_SUBST(ARCH,"arm") ;; - *) AC_SUBST(ARCH,"") ;; -esac - AC_CACHE_CHECK([for the directory containing the Wine tools], wine_cv_toolsdir, [wine_cv_toolsdir="$with_wine_tools" if test -z "$with_wine_tools"; then diff --git a/tools/makedep.c b/tools/makedep.c index cc10540fe7f..41051f9d610 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -157,7 +157,7 @@ static const char *tools_ext; static const char *exe_ext; static const char *dll_ext; static const char *man_ext; -static const char *arch; +static const char *host_cpu; static const char *pe_dir; static const char *so_dir; static const char *crosstarget; @@ -526,6 +526,30 @@ static void strarray_qsort( struct strarray *array, int (*func)(const char **, c } +/******************************************************************* + * normalize_arch + */ +static const char *normalize_arch( const char *arch ) +{ + unsigned int i, j; + + static const char *map[][8] = + { + /* normalized aliases */ + { "i386", "i486", "i586", "i686", "ia32" }, + { "x86_64", "amd64", "x86-64", "x86_amd64", "x64" }, + { "aarch64", "arm64" }, + { "arm" }, + }; + + for (i = 0; i < sizeof(map) / sizeof(map[0]); i++) + for (j = 0; map[i][j]; j++) + if (!strncmp( arch, map[i][j], strlen(map[i][j]) )) + return map[i][0]; + return NULL; +} + + /******************************************************************* * output_filename */ @@ -4410,7 +4434,7 @@ int main( int argc, char *argv[] ) exe_ext = get_expanded_make_variable( top_makefile, "EXEEXT" ); man_ext = get_expanded_make_variable( top_makefile, "api_manext" ); dll_ext = (exe_ext && !strcmp( exe_ext, ".exe" )) ? "" : ".so"; - arch = get_expanded_make_variable( top_makefile, "ARCH" ); + host_cpu = get_expanded_make_variable( top_makefile, "host_cpu" ); crosstarget = get_expanded_make_variable( top_makefile, "CROSSTARGET" ); crossdebug = get_expanded_make_variable( top_makefile, "CROSSDEBUG" ); fontforge = get_expanded_make_variable( top_makefile, "FONTFORGE" ); @@ -4431,10 +4455,10 @@ int main( int argc, char *argv[] ) if (!exe_ext) exe_ext = ""; if (!tools_ext) tools_ext = ""; if (!man_ext) man_ext = "3w"; - if (arch) + if (host_cpu && (host_cpu = normalize_arch( host_cpu ))) { - so_dir = strmake( "$(dlldir)/%s-unix", arch ); - pe_dir = strmake( "$(dlldir)/%s-windows", arch ); + so_dir = strmake( "$(dlldir)/%s-unix", host_cpu ); + pe_dir = strmake( "$(dlldir)/%s-windows", host_cpu ); } else so_dir = pe_dir = "$(dlldir)";
1
0
0
0
← Newer
1
...
33
34
35
36
37
38
39
...
103
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
Results per page:
10
25
50
100
200