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
October 2011
----- 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
3 participants
783 discussions
Start a n
N
ew thread
Andrew Talbot : msi: Add a break to a switch statement.
by Alexandre Julliard
06 Oct '11
06 Oct '11
Module: wine Branch: master Commit: 48a6130279a685c7a858dc15255a9594c08ca50d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=48a6130279a685c7a858dc152…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com> Date: Thu Oct 6 22:29:42 2011 +0100 msi: Add a break to a switch statement. --- dlls/msi/record.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/msi/record.c b/dlls/msi/record.c index 7acbfc7..1dace78 100644 --- a/dlls/msi/record.c +++ b/dlls/msi/record.c @@ -494,6 +494,7 @@ UINT MSI_RecordGetStringW(MSIRECORD *rec, UINT iField, case MSIFIELD_NULL: if( szValue && *pcchValue > 0 ) szValue[0] = 0; + break; default: break; }
1
0
0
0
Andrew Talbot : mshtml: Mark fall-through in switch statement.
by Alexandre Julliard
06 Oct '11
06 Oct '11
Module: wine Branch: master Commit: a29f69718beb646a82d74ebf507004cae5858fe8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a29f69718beb646a82d74ebf5…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com> Date: Thu Oct 6 22:29:38 2011 +0100 mshtml: Mark fall-through in switch statement. --- dlls/mshtml/htmlevent.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 93a5367..2b9e62e 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -1229,6 +1229,7 @@ HRESULT set_event_handler(event_target_t **event_target, nsIDOMNode *nsnode, HTM default: FIXME("not supported vt=%d\n", V_VT(var)); + /* fall through */ case VT_EMPTY: return E_NOTIMPL; }
1
0
0
0
Huw Davies : gdi32: Move some common default fonts to the head of the font list.
by Alexandre Julliard
06 Oct '11
06 Oct '11
Module: wine Branch: master Commit: 5bd2db4521778e38269218be088d86bf1c441713 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5bd2db4521778e38269218be0…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu Oct 6 16:26:08 2011 -0500 gdi32: Move some common default fonts to the head of the font list. --- dlls/gdi32/freetype.c | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 24935df..8a687f4 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -3154,6 +3154,40 @@ static void init_font_list(void) } } +static BOOL move_to_front(const WCHAR *name) +{ + Family *family, *cursor2; + LIST_FOR_EACH_ENTRY_SAFE(family, cursor2, &font_list, Family, entry) + { + if(!strcmpiW(family->FamilyName, name)) + { + list_remove(&family->entry); + list_add_head(&font_list, &family->entry); + return TRUE; + } + } + return FALSE; +} + +static const WCHAR arial[] = {'A','r','i','a','l',0}; +static const WCHAR bitstream_vera_sans[] = {'B','i','t','s','t','r','e','a','m',' ','V','e','r','a',' ','S','a','n','s',0}; +static const WCHAR bitstream_vera_sans_mono[] = {'B','i','t','s','t','r','e','a','m',' ','V','e','r','a',' ','S','a','n','s',' ','M','o','n','o',0}; +static const WCHAR bitstream_vera_serif[] = {'B','i','t','s','t','r','e','a','m',' ','V','e','r','a',' ','S','e','r','i','f',0}; +static const WCHAR courier_new[] = {'C','o','u','r','i','e','r',' ','N','e','w',0}; +static const WCHAR times_new_roman[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n',0}; + +static void reorder_font_list(void) +{ + if(!move_to_front(times_new_roman)) + move_to_front(bitstream_vera_serif); + + if(!move_to_front(courier_new)) + move_to_front(bitstream_vera_sans_mono); + + if(!move_to_front(arial)) + move_to_front(bitstream_vera_sans); +} + /************************************************************* * WineEngInit * @@ -3186,6 +3220,8 @@ BOOL WineEngInit(void) RegCloseKey(hkey_font_cache); + reorder_font_list(); + DumpFontList(); LoadSubstList(); DumpSubstList();
1
0
0
0
Huw Davies : gdi32: Load the font properties from the cache if it exists.
by Alexandre Julliard
06 Oct '11
06 Oct '11
Module: wine Branch: master Commit: 17e72c816b9cbc17aeaae1c2ecf2ba230083817d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=17e72c816b9cbc17aeaae1c2e…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu Oct 6 16:26:07 2011 -0500 gdi32: Load the font properties from the cache if it exists. --- dlls/gdi32/freetype.c | 183 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 181 insertions(+), 2 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index ecd01dc..24935df 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -1145,11 +1145,185 @@ static WCHAR *get_face_name(FT_Face ft_face, FT_UShort name_id, FT_UShort langua return ret; } +static LONG reg_load_dword(HKEY hkey, const WCHAR *value, DWORD *data) +{ + DWORD type, needed; + LONG r = RegQueryValueExW(hkey, value, NULL, &type, NULL, &needed); + if(r != ERROR_SUCCESS) return r; + if(type != REG_DWORD || needed != sizeof(DWORD)) return ERROR_BAD_CONFIGURATION; + return RegQueryValueExW(hkey, value, NULL, &type, (BYTE*)data, &needed); +} + static inline LONG reg_save_dword(HKEY hkey, const WCHAR *value, DWORD data) { return RegSetValueExW(hkey, value, 0, REG_DWORD, (BYTE*)&data, sizeof(DWORD)); } +static void load_face(HKEY hkey_face, WCHAR *face_name, Family *family) +{ + DWORD needed; + DWORD num_strikes, max_strike_key_len; + + /* If we have a File Name key then this is a real font, not just the parent + key of a bunch of non-scalable strikes */ + if(RegQueryValueExA(hkey_face, "File Name", NULL, NULL, NULL, &needed) == ERROR_SUCCESS) + { + DWORD italic, bold; + Face *face; + face = HeapAlloc(GetProcessHeap(), 0, sizeof(*face)); + face->cached_enum_data = NULL; + + face->file = HeapAlloc(GetProcessHeap(), 0, needed); + RegQueryValueExA(hkey_face, "File Name", NULL, NULL, (BYTE*)face->file, &needed); + + face->StyleName = strdupW(face_name); + face->family = family; + + if(RegQueryValueExW(hkey_face, face_full_name_value, NULL, NULL, NULL, &needed) == ERROR_SUCCESS) + { + WCHAR *fullName = HeapAlloc(GetProcessHeap(), 0, needed); + RegQueryValueExW(hkey_face, face_full_name_value, NULL, NULL, (BYTE*)fullName, &needed); + face->FullName = fullName; + } + else + face->FullName = NULL; + + reg_load_dword(hkey_face, face_index_value, (DWORD*)&face->face_index); + reg_load_dword(hkey_face, face_italic_value, &italic); + reg_load_dword(hkey_face, face_bold_value, &bold); + reg_load_dword(hkey_face, face_version_value, (DWORD*)&face->font_version); + reg_load_dword(hkey_face, face_external_value, (DWORD*)&face->external); + + needed = sizeof(face->fs); + RegQueryValueExW(hkey_face, face_font_sig_value, NULL, NULL, (BYTE*)&face->fs, &needed); + memset(&face->fs_links, 0, sizeof(face->fs_links)); + + if(reg_load_dword(hkey_face, face_height_value, (DWORD*)&face->size.height) != ERROR_SUCCESS) + { + face->scalable = TRUE; + memset(&face->size, 0, sizeof(face->size)); + } + else + { + face->scalable = FALSE; + reg_load_dword(hkey_face, face_width_value, (DWORD*)&face->size.width); + reg_load_dword(hkey_face, face_size_value, (DWORD*)&face->size.size); + reg_load_dword(hkey_face, face_x_ppem_value, (DWORD*)&face->size.x_ppem); + reg_load_dword(hkey_face, face_y_ppem_value, (DWORD*)&face->size.y_ppem); + reg_load_dword(hkey_face, face_internal_leading_value, (DWORD*)&face->size.internal_leading); + + TRACE("Adding bitmap size h %d w %d size %ld x_ppem %ld y_ppem %ld\n", + face->size.height, face->size.width, face->size.size >> 6, + face->size.x_ppem >> 6, face->size.y_ppem >> 6); + } + + face->ntmFlags = 0; + if (italic) face->ntmFlags |= NTM_ITALIC; + if (bold) face->ntmFlags |= NTM_BOLD; + if (face->ntmFlags == 0) face->ntmFlags = NTM_REGULAR; + + TRACE("fsCsb = %08x %08x/%08x %08x %08x %08x\n", + face->fs.fsCsb[0], face->fs.fsCsb[1], + face->fs.fsUsb[0], face->fs.fsUsb[1], + face->fs.fsUsb[2], face->fs.fsUsb[3]); + + if(!italic && !bold) + list_add_head(&family->faces, &face->entry); + else + list_add_tail(&family->faces, &face->entry); + + TRACE("Added font %s %s\n", debugstr_w(family->FamilyName), debugstr_w(face->StyleName)); + } + + /* do we have any bitmap strikes? */ + RegQueryInfoKeyW(hkey_face, NULL, NULL, NULL, &num_strikes, &max_strike_key_len, NULL, NULL, + NULL, NULL, NULL, NULL); + if(num_strikes != 0) + { + WCHAR strike_name[10]; + DWORD strike_index = 0; + + needed = sizeof(strike_name) / sizeof(WCHAR); + while(RegEnumKeyExW(hkey_face, strike_index++, strike_name, &needed, + NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + { + HKEY hkey_strike; + RegOpenKeyExW(hkey_face, strike_name, 0, KEY_ALL_ACCESS, &hkey_strike); + load_face(hkey_strike, face_name, family); + RegCloseKey(hkey_strike); + needed = sizeof(strike_name) / sizeof(WCHAR); + } + } +} + +static void load_font_list_from_cache(HKEY hkey_font_cache) +{ + DWORD max_family_key_len, size; + WCHAR *family_name; + DWORD family_index = 0; + Family *family; + HKEY hkey_family; + + RegQueryInfoKeyW(hkey_font_cache, NULL, NULL, NULL, NULL, &max_family_key_len, NULL, NULL, + NULL, NULL, NULL, NULL); + family_name = HeapAlloc(GetProcessHeap(), 0, (max_family_key_len + 1) * sizeof(WCHAR)); + + size = max_family_key_len + 1; + while(RegEnumKeyExW(hkey_font_cache, family_index++, family_name, &size, + NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + { + WCHAR *english_family = NULL; + DWORD face_index = 0; + WCHAR *face_name; + DWORD max_face_key_len; + + RegOpenKeyExW(hkey_font_cache, family_name, 0, KEY_ALL_ACCESS, &hkey_family); + TRACE("opened family key %s\n", debugstr_w(family_name)); + if(RegQueryValueExW(hkey_family, english_name_value, NULL, NULL, NULL, &size) == ERROR_SUCCESS) + { + english_family = HeapAlloc(GetProcessHeap(), 0, size); + RegQueryValueExW(hkey_family, english_name_value, NULL, NULL, (BYTE*)english_family, &size); + } + + family = HeapAlloc(GetProcessHeap(), 0, sizeof(*family)); + family->FamilyName = strdupW(family_name); + family->EnglishName = english_family; + list_init(&family->faces); + list_add_tail(&font_list, &family->entry); + + if(english_family) + { + FontSubst *subst = HeapAlloc(GetProcessHeap(), 0, sizeof(*subst)); + subst->from.name = strdupW(english_family); + subst->from.charset = -1; + subst->to.name = strdupW(family_name); + subst->to.charset = -1; + add_font_subst(&font_subst_list, subst, 0); + } + + RegQueryInfoKeyW(hkey_family, NULL, NULL, NULL, NULL, &max_face_key_len, NULL, NULL, + NULL, NULL, NULL, NULL); + + face_name = HeapAlloc(GetProcessHeap(), 0, (max_face_key_len + 1) * sizeof(WCHAR)); + size = max_face_key_len + 1; + while(RegEnumKeyExW(hkey_family, face_index++, face_name, &size, + NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + { + HKEY hkey_face; + + RegOpenKeyExW(hkey_family, face_name, 0, KEY_ALL_ACCESS, &hkey_face); + load_face(hkey_face, face_name, family); + RegCloseKey(hkey_face); + size = max_face_key_len + 1; + } + HeapFree(GetProcessHeap(), 0, face_name); + RegCloseKey(hkey_family); + size = max_family_key_len + 1; + } + + HeapFree(GetProcessHeap(), 0, family_name); +} + static LONG create_font_cache_key(HKEY *hkey, DWORD *disposition) { LONG ret; @@ -3005,7 +3179,10 @@ BOOL WineEngInit(void) create_font_cache_key(&hkey_font_cache, &disposition); - init_font_list(); + if(disposition == REG_CREATED_NEW_KEY) + init_font_list(); + else + load_font_list_from_cache(hkey_font_cache); RegCloseKey(hkey_font_cache); @@ -3013,7 +3190,9 @@ BOOL WineEngInit(void) LoadSubstList(); DumpSubstList(); LoadReplaceList(); - update_reg_entries(); + + if(disposition == REG_CREATED_NEW_KEY) + update_reg_entries(); update_system_links(); init_system_links();
1
0
0
0
Huw Davies : gdi32: Cache the loaded font list properties.
by Alexandre Julliard
06 Oct '11
06 Oct '11
Module: wine Branch: master Commit: a155292f98f62c10eaf3b9328cbd8c085b8818e9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a155292f98f62c10eaf3b9328…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu Oct 6 16:26:06 2011 -0500 gdi32: Cache the loaded font list properties. --- dlls/gdi32/freetype.c | 129 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 122 insertions(+), 7 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=a155292f98f62c10eaf3b…
1
0
0
0
Huw Davies : gdi32: Move the font list initialisation to a separate function.
by Alexandre Julliard
06 Oct '11
06 Oct '11
Module: wine Branch: master Commit: 63070bdf89a7a5454004cd4cf40e6ace2773badd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=63070bdf89a7a5454004cd4cf…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu Oct 6 16:26:05 2011 -0500 gdi32: Move the font list initialisation to a separate function. --- dlls/gdi32/freetype.c | 64 +++++++++++++++++++++++++++--------------------- 1 files changed, 36 insertions(+), 28 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index ae8ca41..62c0504 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -2745,12 +2745,7 @@ sym_not_found: return FALSE; } -/************************************************************* - * WineEngInit - * - * Initialize FreeType library and create a list of available faces - */ -BOOL WineEngInit(void) +static void init_font_list(void) { static const WCHAR dot_fonW[] = {'.','f','o','n','\0'}; static const WCHAR pathW[] = {'P','a','t','h',0}; @@ -2758,22 +2753,8 @@ BOOL WineEngInit(void) DWORD valuelen, datalen, i = 0, type, dlen, vlen; WCHAR windowsdir[MAX_PATH]; char *unixname; - HANDLE font_mutex; const char *data_dir; - TRACE("\n"); - - /* update locale dependent font info in registry */ - update_font_info(); - - if(!init_freetype()) return FALSE; - - if((font_mutex = CreateMutexW(NULL, FALSE, font_mutex_nameW)) == NULL) { - ERR("Failed to create font mutex\n"); - return FALSE; - } - WaitForSingleObject(font_mutex, INFINITE); - delete_external_font_keys(); /* load the system bitmap fonts */ @@ -2791,7 +2772,8 @@ BOOL WineEngInit(void) /* load the system truetype fonts */ data_dir = wine_get_data_dir(); if (!data_dir) data_dir = wine_get_build_dir(); - if (data_dir && (unixname = HeapAlloc(GetProcessHeap(), 0, strlen(data_dir) + sizeof("/fonts/")))) { + if (data_dir && (unixname = HeapAlloc(GetProcessHeap(), 0, strlen(data_dir) + sizeof("/fonts/")))) + { strcpy(unixname, data_dir); strcat(unixname, "/fonts/"); ReadFontDir(unixname, TRUE); @@ -2804,20 +2786,22 @@ BOOL WineEngInit(void) will skip these. */ if(RegOpenKeyW(HKEY_LOCAL_MACHINE, is_win9x() ? win9x_font_reg_key : winnt_font_reg_key, - &hkey) == ERROR_SUCCESS) { + &hkey) == ERROR_SUCCESS) + { LPWSTR data, valueW; RegQueryInfoKeyW(hkey, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - &valuelen, &datalen, NULL, NULL); + &valuelen, &datalen, NULL, NULL); - valuelen++; /* returned value doesn't include room for '\0' */ - valueW = HeapAlloc(GetProcessHeap(), 0, valuelen * sizeof(WCHAR)); - data = HeapAlloc(GetProcessHeap(), 0, datalen * sizeof(WCHAR)); + valuelen++; /* returned value doesn't include room for '\0' */ + valueW = HeapAlloc(GetProcessHeap(), 0, valuelen * sizeof(WCHAR)); + data = HeapAlloc(GetProcessHeap(), 0, datalen * sizeof(WCHAR)); if (valueW && data) { dlen = datalen * sizeof(WCHAR); vlen = valuelen; while(RegEnumValueW(hkey, i++, valueW, &vlen, NULL, &type, (LPBYTE)data, - &dlen) == ERROR_SUCCESS) { + &dlen) == ERROR_SUCCESS) + { if(data[0] && (data[1] == ':')) { if((unixname = wine_get_unix_file_name(data))) @@ -2848,7 +2832,7 @@ BOOL WineEngInit(void) } HeapFree(GetProcessHeap(), 0, data); HeapFree(GetProcessHeap(), 0, valueW); - RegCloseKey(hkey); + RegCloseKey(hkey); } load_fontconfig_fonts(); @@ -2885,6 +2869,30 @@ BOOL WineEngInit(void) } RegCloseKey(hkey); } +} + +/************************************************************* + * WineEngInit + * + * Initialize FreeType library and create a list of available faces + */ +BOOL WineEngInit(void) +{ + HANDLE font_mutex; + + /* update locale dependent font info in registry */ + update_font_info(); + + if(!init_freetype()) return FALSE; + + if((font_mutex = CreateMutexW(NULL, FALSE, font_mutex_nameW)) == NULL) + { + ERR("Failed to create font mutex\n"); + return FALSE; + } + WaitForSingleObject(font_mutex, INFINITE); + + init_font_list(); DumpFontList(); LoadSubstList();
1
0
0
0
Huw Davies : gdi32: Keep track of the english family name if there' s a localised name as well.
by Alexandre Julliard
06 Oct '11
06 Oct '11
Module: wine Branch: master Commit: ab1373d84710350d73131c993afdc08acbab5bdb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ab1373d84710350d73131c993…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu Oct 6 16:26:04 2011 -0500 gdi32: Keep track of the english family name if there's a localised name as well. --- dlls/gdi32/freetype.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 81c704b..ae8ca41 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -282,6 +282,7 @@ typedef struct tagFace { typedef struct tagFamily { struct list entry; const WCHAR *FamilyName; + const WCHAR *EnglishName; struct list faces; } Family; @@ -1378,6 +1379,7 @@ static INT AddFontToList(const char *file, void *font_data_ptr, DWORD font_data_ if(!family) { family = HeapAlloc(GetProcessHeap(), 0, sizeof(*family)); family->FamilyName = strdupW(localised_family ? localised_family : english_family); + family->EnglishName = localised_family ? strdupW(english_family) : NULL; list_init(&family->faces); list_add_tail(&font_list, &family->entry);
1
0
0
0
Nikolay Sivov : oleaut32/typelib: Use BSTR for filename.
by Alexandre Julliard
06 Oct '11
06 Oct '11
Module: wine Branch: master Commit: 8899c2e59aecf824d8b3fbbdc0a5464e2485508b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8899c2e59aecf824d8b3fbbdc…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Oct 6 13:55:47 2011 -0500 oleaut32/typelib: Use BSTR for filename. --- dlls/oleaut32/typelib2.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dlls/oleaut32/typelib2.c b/dlls/oleaut32/typelib2.c index f3f424a..d761491 100644 --- a/dlls/oleaut32/typelib2.c +++ b/dlls/oleaut32/typelib2.c @@ -167,7 +167,7 @@ typedef struct tagICreateTypeLib2Impl ITypeLib2 ITypeLib2_iface; LONG ref; - WCHAR *filename; + BSTR filename; MSFT_Header typelib_header; INT helpStringDll; @@ -4329,7 +4329,7 @@ static ULONG WINAPI ICreateTypeLib2_fnRelease(ICreateTypeLib2 *iface) This->typelib_segment_data[i] = NULL; } - heap_free(This->filename); + SysFreeString(This->filename); This->filename = NULL; while (This->typeinfos) { @@ -5216,22 +5216,21 @@ static const ITypeLib2Vtbl typelib2vt = ITypeLib2_fnGetAllCustData, }; -static ICreateTypeLib2 *ICreateTypeLib2_Constructor(SYSKIND syskind, LPCOLESTR szFile) +static ICreateTypeLib2 *ICreateTypeLib2_Constructor(SYSKIND syskind, LPCOLESTR filename) { ICreateTypeLib2Impl *create_tlib2; int failed = 0; - TRACE("Constructing ICreateTypeLib2 (%d, %s)\n", syskind, debugstr_w(szFile)); + TRACE("Constructing ICreateTypeLib2 (%d, %s)\n", syskind, debugstr_w(filename)); create_tlib2 = heap_alloc_zero(sizeof(ICreateTypeLib2Impl)); if (!create_tlib2) return NULL; - create_tlib2->filename = heap_alloc((strlenW(szFile) + 1) * sizeof(WCHAR)); + create_tlib2->filename = SysAllocString(filename); if (!create_tlib2->filename) { heap_free(create_tlib2); return NULL; } - strcpyW(create_tlib2->filename, szFile); ctl2_init_header(create_tlib2); ctl2_init_segdir(create_tlib2);
1
0
0
0
Nikolay Sivov : oleaut32/typelib: Properly handle allocation failure on creation.
by Alexandre Julliard
06 Oct '11
06 Oct '11
Module: wine Branch: master Commit: c71637b69272b215cecf3a7aa5c6536f3d3c51c3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c71637b69272b215cecf3a7aa…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Oct 6 13:51:01 2011 -0500 oleaut32/typelib: Properly handle allocation failure on creation. --- dlls/oleaut32/typelib2.c | 53 ++++++++++++++++++++++++++-------------------- 1 files changed, 30 insertions(+), 23 deletions(-) diff --git a/dlls/oleaut32/typelib2.c b/dlls/oleaut32/typelib2.c index a7d43df..f3f424a 100644 --- a/dlls/oleaut32/typelib2.c +++ b/dlls/oleaut32/typelib2.c @@ -5218,49 +5218,56 @@ static const ITypeLib2Vtbl typelib2vt = static ICreateTypeLib2 *ICreateTypeLib2_Constructor(SYSKIND syskind, LPCOLESTR szFile) { - ICreateTypeLib2Impl *pCreateTypeLib2Impl; + ICreateTypeLib2Impl *create_tlib2; int failed = 0; TRACE("Constructing ICreateTypeLib2 (%d, %s)\n", syskind, debugstr_w(szFile)); - pCreateTypeLib2Impl = heap_alloc_zero(sizeof(ICreateTypeLib2Impl)); - if (!pCreateTypeLib2Impl) return NULL; + create_tlib2 = heap_alloc_zero(sizeof(ICreateTypeLib2Impl)); + if (!create_tlib2) return NULL; - pCreateTypeLib2Impl->filename = heap_alloc((strlenW(szFile) + 1) * sizeof(WCHAR)); - if (!pCreateTypeLib2Impl->filename) { - heap_free(pCreateTypeLib2Impl); + create_tlib2->filename = heap_alloc((strlenW(szFile) + 1) * sizeof(WCHAR)); + if (!create_tlib2->filename) { + heap_free(create_tlib2); return NULL; } - strcpyW(pCreateTypeLib2Impl->filename, szFile); + strcpyW(create_tlib2->filename, szFile); - ctl2_init_header(pCreateTypeLib2Impl); - ctl2_init_segdir(pCreateTypeLib2Impl); + ctl2_init_header(create_tlib2); + ctl2_init_segdir(create_tlib2); - pCreateTypeLib2Impl->typelib_header.varflags |= syskind; + create_tlib2->typelib_header.varflags |= syskind; /* * The following two calls return an offset or -1 if out of memory. We * specifically need an offset of 0, however, so... */ - if (ctl2_alloc_segment(pCreateTypeLib2Impl, MSFT_SEG_GUIDHASH, 0x80, 0x80)) { failed = 1; } - if (ctl2_alloc_segment(pCreateTypeLib2Impl, MSFT_SEG_NAMEHASH, 0x200, 0x200)) { failed = 1; } - - pCreateTypeLib2Impl->typelib_guidhash_segment = (int *)pCreateTypeLib2Impl->typelib_segment_data[MSFT_SEG_GUIDHASH]; - pCreateTypeLib2Impl->typelib_namehash_segment = (int *)pCreateTypeLib2Impl->typelib_segment_data[MSFT_SEG_NAMEHASH]; + if (ctl2_alloc_segment(create_tlib2, MSFT_SEG_GUIDHASH, 0x80, 0x80) == 0) + { + create_tlib2->typelib_guidhash_segment = (int *)create_tlib2->typelib_segment_data[MSFT_SEG_GUIDHASH]; + memset(create_tlib2->typelib_guidhash_segment, 0xff, 0x80); + } + else + failed = 1; - memset(pCreateTypeLib2Impl->typelib_guidhash_segment, 0xff, 0x80); - memset(pCreateTypeLib2Impl->typelib_namehash_segment, 0xff, 0x200); + if (ctl2_alloc_segment(create_tlib2, MSFT_SEG_NAMEHASH, 0x200, 0x200) == 0) + { + create_tlib2->typelib_namehash_segment = (int *)create_tlib2->typelib_segment_data[MSFT_SEG_NAMEHASH]; + memset(create_tlib2->typelib_namehash_segment, 0xff, 0x200); + } + else + failed = 1; - pCreateTypeLib2Impl->ICreateTypeLib2_iface.lpVtbl = &ctypelib2vt; - pCreateTypeLib2Impl->ITypeLib2_iface.lpVtbl = &typelib2vt; - pCreateTypeLib2Impl->ref = 1; + create_tlib2->ICreateTypeLib2_iface.lpVtbl = &ctypelib2vt; + create_tlib2->ITypeLib2_iface.lpVtbl = &typelib2vt; + create_tlib2->ref = 1; if (failed) { - ICreateTypeLib2_fnRelease(&pCreateTypeLib2Impl->ICreateTypeLib2_iface); - return 0; + ICreateTypeLib2_fnRelease(&create_tlib2->ICreateTypeLib2_iface); + return NULL; } - return &pCreateTypeLib2Impl->ICreateTypeLib2_iface; + return &create_tlib2->ICreateTypeLib2_iface; } /******************************************************************************
1
0
0
0
Frédéric Delanoy : cmd: Avoid reading char by char from files.
by Alexandre Julliard
06 Oct '11
06 Oct '11
Module: wine Branch: master Commit: cd30c52b35e7e8884e9b66b6d5cd9822412f9a33 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cd30c52b35e7e8884e9b66b6d…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Thu Oct 6 18:50:32 2011 +0200 cmd: Avoid reading char by char from files. --- programs/cmd/batch.c | 54 ++++++++++++++++++++++++++----------------------- 1 files changed, 29 insertions(+), 25 deletions(-) diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c index 79bb009..a276d3e 100644 --- a/programs/cmd/batch.c +++ b/programs/cmd/batch.c @@ -188,38 +188,42 @@ WCHAR *WCMD_parameter (WCHAR *s, int n, WCHAR **where, WCHAR **end) { WCHAR *WCMD_fgets(WCHAR *buf, int noChars, HANDLE h) { - DWORD bytes, charsRead; + DWORD charsRead; BOOL status; - WCHAR *p; + LARGE_INTEGER filepos; + int i; /* We can't use the native f* functions because of the filename syntax differences between DOS and Unix. Also need to lose the LF (or CRLF) from the line. */ - p = buf; - if (WCMD_is_console_handle(h)) { - status = ReadConsoleW(h, buf, noChars, &charsRead, NULL); - if (!status) return NULL; - if (buf[charsRead-2] == '\r') - buf[charsRead-2] = '\0'; /* Strip \r\n */ - else { - /* Truncate */ - buf[noChars-1] = '\0'; - } - return p; + if (!WCMD_is_console_handle(h)) { + /* Save current file position */ + filepos.QuadPart = 0; + SetFilePointerEx(h, filepos, &filepos, FILE_CURRENT); } - /* TODO: More intelligent buffering for reading lines from files */ - do { - status = WCMD_ReadFile(h, buf, 1, &bytes); - if ((status == 0) || ((bytes == 0) && (buf == p))) return NULL; - if (*buf == '\n') bytes = 0; - else if (*buf != '\r') { - buf++; - noChars--; - } - *buf = '\0'; - } while ((bytes == 1) && (noChars > 1)); - return p; + status = WCMD_ReadFile(h, buf, noChars, &charsRead); + if (!status || charsRead == 0) return NULL; + + /* Find first EOL */ + for (i = 0; i < charsRead; i++) { + if (buf[i] == '\n' || buf[i] == '\r') + break; + } + + if (!WCMD_is_console_handle(h) && i != charsRead) { + /* Sets file pointer to the start of the next line, if any */ + filepos.QuadPart += i + 1 + (buf[i] == '\r' ? 1 : 0); + SetFilePointerEx(h, filepos, NULL, FILE_BEGIN); + } + + /* Truncate at EOL (or end of buffer) */ + if (i == noChars) + i--; + + buf[i] = '\0'; + + return buf; } /* WCMD_splitpath - copied from winefile as no obvious way to use it otherwise */
1
0
0
0
← Newer
1
...
64
65
66
67
68
69
70
...
79
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
Results per page:
10
25
50
100
200