ReactOS.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
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
List overview
Download
Ros-diffs
April 2017
----- 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
ros-diffs@reactos.org
14 participants
179 discussions
Start a n
N
ew thread
[mjansen] 74316: [WIN32SS] Addendum to r74312 and r74309, fix some bad memory leaks. CORE-10876 Thanks Giannis and Thomas :)
by mjansen@svn.reactos.org
Author: mjansen Date: Fri Apr 14 21:22:18 2017 New Revision: 74316 URL:
http://svn.reactos.org/svn/reactos?rev=74316&view=rev
Log: [WIN32SS] Addendum to r74312 and r74309, fix some bad memory leaks. CORE-10876 Thanks Giannis and Thomas :) Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/freetype…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] Fri Apr 14 21:22:18 2017 @@ -2052,7 +2052,7 @@ NTSTATUS Status = STATUS_NOT_FOUND; ANSI_STRING AnsiName; - RtlInitUnicodeString(pNameW, NULL); + RtlFreeUnicodeString(pNameW); Count = FT_Get_Sfnt_Name_Count(Face); for (i = 0; i < Count; ++i) @@ -2202,6 +2202,7 @@ else { UNICODE_STRING NameW; + RtlInitUnicodeString(&NameW, NULL); status = IntGetFontLocalizedName(&NameW, Face, TT_NAME_ID_FONT_FAMILY, gusLanguageID); if (NT_SUCCESS(status)) @@ -2640,6 +2641,7 @@ { DPRINT1("Conversion failed\n"); ExFreePoolWithTag(NewEntry, TAG_FONT); + FT_Bitmap_Done(GlyphSlot->library, &AlignedBitmap); FT_Done_Glyph((FT_Glyph)BitmapGlyph); return NULL; }
7 years, 8 months
1
0
0
0
[ekohl] 74315: [SCHEDSVC] Calculate the next start time of a job and store it in the job object. DaysOfMonth and DaysOfWeek are not taken into account yet.
by ekohl@svn.reactos.org
Author: ekohl Date: Fri Apr 14 21:16:37 2017 New Revision: 74315 URL:
http://svn.reactos.org/svn/reactos?rev=74315&view=rev
Log: [SCHEDSVC] Calculate the next start time of a job and store it in the job object. DaysOfMonth and DaysOfWeek are not taken into account yet. Modified: trunk/reactos/base/services/schedsvc/job.c trunk/reactos/base/services/schedsvc/precomp.h trunk/reactos/base/services/schedsvc/rpcserver.c Modified: trunk/reactos/base/services/schedsvc/job.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/schedsvc/job…
============================================================================== --- trunk/reactos/base/services/schedsvc/job.c [iso-8859-1] (original) +++ trunk/reactos/base/services/schedsvc/job.c [iso-8859-1] Fri Apr 14 21:16:37 2017 @@ -282,7 +282,8 @@ /* Release the job list lock */ RtlReleaseResource(&JobListLock); - // Calculate start time + /* Calculate the next start time */ + CalculateNextStartTime(pJob); // Insert job into the start list @@ -310,38 +311,62 @@ } -#if 0 +static +WORD +DaysOfMonth( + WORD wMonth, + WORD wYear) +{ + WORD wDaysArray[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + + if (wMonth == 2 && wYear % 4 == 0 && wYear % 400 != 0) + return 29; + + return wDaysArray[wMonth]; +} + + VOID CalculateNextStartTime(PJOB pJob) { - SYSTEMTIME Time; - DWORD_PTR JobTime; - WORD wDay; - BOOL bToday = FALSE; - - GetLocalTime(&Time); - - Now = (DWORD_PTR)Time.wHour * 3600000 + - (DWORD_PTR)Time.wMinute * 60000; - if (pJob->JobTime > Now) - bToday = TRUE; - - if (pJob->DaysOfMonth != 0) + SYSTEMTIME StartTime; + DWORD_PTR Now; + + GetLocalTime(&StartTime); + + Now = (DWORD_PTR)StartTime.wHour * 3600000 + + (DWORD_PTR)StartTime.wMinute * 60000; + + StartTime.wMilliseconds = 0; + StartTime.wSecond = 0; + StartTime.wHour = (WORD)(pJob->JobTime / 3600000); + StartTime.wMinute = (WORD)((pJob->JobTime % 3600000) / 60000); + + /* Start the job tomorrow */ + if (Now > pJob->JobTime) { - wDay = 0; - for (i = Time.wDay - 1; i < 32; i++) - { - if (pJob->DaysOfMonth && (1 << i)) + if (StartTime.wDay + 1 > DaysOfMonth(StartTime.wMonth, StartTime.wYear)) + { + if (StartTime.wMonth == 12) { - wDay = i; - break; + StartTime.wDay = 1; + StartTime.wMonth = 1; + StartTime.wYear++; } - } - ERR("Next day this month: %hu\n", wDay); + else + { + StartTime.wDay = 1; + StartTime.wMonth++; + } + } + else + { + StartTime.wDay++; + } } - else if (pJob->DaysOfWeek != 0) - { - - } -} -#endif + + ERR("Next start: %02hu:%02hu %02hu.%02hu.%hu\n", StartTime.wHour, + StartTime.wMinute, StartTime.wDay, StartTime.wMonth, StartTime.wYear); + + SystemTimeToFileTime(&StartTime, &pJob->StartTime); +} Modified: trunk/reactos/base/services/schedsvc/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/schedsvc/pre…
============================================================================== --- trunk/reactos/base/services/schedsvc/precomp.h [iso-8859-1] (original) +++ trunk/reactos/base/services/schedsvc/precomp.h [iso-8859-1] Fri Apr 14 21:16:37 2017 @@ -28,7 +28,7 @@ LIST_ENTRY JobEntry; LIST_ENTRY StartEntry; - LARGE_INTEGER StartTime; + FILETIME StartTime; WCHAR Name[9]; DWORD JobId; @@ -64,6 +64,9 @@ LONG LoadJobs(VOID); +VOID +CalculateNextStartTime( + PJOB pJob); /* rpcserver.c */ Modified: trunk/reactos/base/services/schedsvc/rpcserver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/schedsvc/rpc…
============================================================================== --- trunk/reactos/base/services/schedsvc/rpcserver.c [iso-8859-1] (original) +++ trunk/reactos/base/services/schedsvc/rpcserver.c [iso-8859-1] Fri Apr 14 21:16:37 2017 @@ -121,11 +121,12 @@ /* Save the job in the registry */ SaveJob(pJob); - // Calculate start time - - // Insert job into start list - - // Update start timer + /* Calculate the next start time */ + CalculateNextStartTime(pJob); + + // Insert job into the start list + + // Update the start timer /* Return the new job ID */ *pJobId = pJob->JobId; @@ -162,9 +163,9 @@ if ((CurrentJob->JobId >= MinJobId) && (CurrentJob->JobId <= MaxJobId)) { - // Remove job from start list - - // Update start timer + // Remove job from the start list + + // Update the start timer /* Remove the job from the registry */ DeleteJob(CurrentJob);
7 years, 8 months
1
0
0
0
[gadamopoulos] 74314: [SHELLUTILS.H] - Remove the ShellObjectCreator templates that allowed the caller to pass an arbitrary interface pointer. Leaving only the templates that take an void ** ppv pa...
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Fri Apr 14 20:03:46 2017 New Revision: 74314 URL:
http://svn.reactos.org/svn/reactos?rev=74314&view=rev
Log: [SHELLUTILS.H] - Remove the ShellObjectCreator templates that allowed the caller to pass an arbitrary interface pointer. Leaving only the templates that take an void ** ppv parameter means that the callers are forced to use IID_PPV_ARG. This makes it less likely to have a pointer to an wrong interface. - Fix the callers to always use IID_PPV_ARG. - Rewrite the ShellObjectCreator templates to create the objects using the ATL CreateInstance thus allowing internal ATL methods to be called. [BROWSEUI] -Let CBandSite_CreateInstance take an additional parameter for the outer object since CBandSite is aggregatable. Create the object using the ATL creator class. Modified: trunk/reactos/base/shell/rshell/misc.cpp trunk/reactos/base/shell/rshell/rshell.spec trunk/reactos/dll/win32/browseui/shellbars/CBandSite.cpp trunk/reactos/dll/win32/browseui/shellbars/CSHEnumClassesOfCategories.cpp trunk/reactos/dll/win32/shell32/CDefView.cpp trunk/reactos/dll/win32/shell32/CEnumIDListBase.cpp trunk/reactos/dll/win32/shell32/CIDLDataObj.cpp trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.cpp trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.h trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp trunk/reactos/dll/win32/shell32/folders/CNetFolder.cpp trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp trunk/reactos/dll/win32/shell32/shell32.cpp trunk/reactos/sdk/include/reactos/shellutils.h Modified: trunk/reactos/base/shell/rshell/misc.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/misc.cpp…
============================================================================== --- trunk/reactos/base/shell/rshell/misc.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/rshell/misc.cpp [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -61,8 +61,6 @@ HRESULT WINAPI CMenuSite_Constructor(REFIID riid, LPVOID *ppv); HRESULT WINAPI CMenuBand_Constructor(REFIID riid, LPVOID *ppv); HRESULT WINAPI CMergedFolder_Constructor(REFIID riid, LPVOID *ppv); -HRESULT WINAPI CBandSite_CreateInstance(REFIID riid, void **ppv); -HRESULT WINAPI CBandSiteMenu_CreateInstance(REFIID riid, void **ppv); } DWORD WINAPI WinList_Init(void) Modified: trunk/reactos/base/shell/rshell/rshell.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/rshell.s…
============================================================================== --- trunk/reactos/base/shell/rshell/rshell.spec [iso-8859-1] (original) +++ trunk/reactos/base/shell/rshell/rshell.spec [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -7,7 +7,7 @@ @ stdcall CMenuSite_Constructor(ptr ptr); @ stdcall CMenuBand_Constructor(ptr ptr); @ stdcall CMergedFolder_Constructor(ptr ptr); -@ stdcall CBandSite_CreateInstance(ptr ptr) +@ stdcall CBandSite_CreateInstance(ptr ptr ptr) @ stdcall CBandSiteMenu_CreateInstance(ptr ptr) @ stdcall ShellDDEInit(long); @ stdcall SHCreateDesktop(ptr); Modified: trunk/reactos/dll/win32/browseui/shellbars/CBandSite.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/shellba…
============================================================================== --- trunk/reactos/dll/win32/browseui/shellbars/CBandSite.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/shellbars/CBandSite.cpp [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -831,7 +831,7 @@ } extern "C" -HRESULT WINAPI CBandSite_CreateInstance(REFIID riid, void **ppv) -{ - return ShellObjectCreator<CBandSite>(riid, ppv); -} +HRESULT WINAPI CBandSite_CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, void **ppv) +{ + return CBandSite::_CreatorClass::CreateInstance(pUnkOuter, riid, ppv); +} Modified: trunk/reactos/dll/win32/browseui/shellbars/CSHEnumClassesOfCategories.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/shellba…
============================================================================== --- trunk/reactos/dll/win32/browseui/shellbars/CSHEnumClassesOfCategories.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/shellbars/CSHEnumClassesOfCategories.cpp [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -327,8 +327,8 @@ { HRESULT hr; - hr = ShellObjectCreatorInit<CSHEnumClassesOfCategories, ULONG, CATID*, ULONG, CATID*, IEnumGUID>( - cImplemented, pImplemented, cRequired, pRequired, IID_IEnumGUID, out); + hr = ShellObjectCreatorInit<CSHEnumClassesOfCategories>( + cImplemented, pImplemented, cRequired, pRequired, IID_PPV_ARG(IEnumGUID, out)); if (FAILED_UNEXPECTEDLY(hr)) return hr; return S_OK; Modified: trunk/reactos/dll/win32/shell32/CDefView.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefView…
============================================================================== --- trunk/reactos/dll/win32/shell32/CDefView.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CDefView.cpp [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -3156,7 +3156,7 @@ */ HRESULT WINAPI IShellView_Constructor(IShellFolder *pFolder, IShellView **newView) { - return ShellObjectCreatorInit<CDefView>(pFolder, IID_IShellView, newView); + return ShellObjectCreatorInit<CDefView>(pFolder, IID_PPV_ARG(IShellView, newView)); } HRESULT WINAPI CDefView_Constructor(IShellFolder *pFolder, REFIID riid, LPVOID * ppvOut) Modified: trunk/reactos/dll/win32/shell32/CEnumIDListBase.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CEnumIDL…
============================================================================== --- trunk/reactos/dll/win32/shell32/CEnumIDListBase.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CEnumIDListBase.cpp [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -281,5 +281,5 @@ */ HRESULT IEnumIDList_Constructor(IEnumIDList **enumerator) { - return ShellObjectCreator<CEnumIDListBase>(IID_IEnumIDList, enumerator); -} + return ShellObjectCreator<CEnumIDListBase>(IID_PPV_ARG(IEnumIDList, enumerator)); +} Modified: trunk/reactos/dll/win32/shell32/CIDLDataObj.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CIDLData…
============================================================================== --- trunk/reactos/dll/win32/shell32/CIDLDataObj.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CIDLDataObj.cpp [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -129,7 +129,7 @@ HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **ppFormat) { - return ShellObjectCreatorInit<IEnumFORMATETCImpl>(cfmt, afmt, IID_IEnumFORMATETC, ppFormat); + return ShellObjectCreatorInit<IEnumFORMATETCImpl>(cfmt, afmt, IID_PPV_ARG(IEnumFORMATETC, ppFormat)); } @@ -410,7 +410,7 @@ */ HRESULT IDataObject_Constructor(HWND hwndOwner, PCIDLIST_ABSOLUTE pMyPidl, PCUIDLIST_RELATIVE_ARRAY apidl, UINT cidl, IDataObject **dataObject) { - return ShellObjectCreatorInit<CIDLDataObj>(hwndOwner, pMyPidl, apidl, cidl, IID_IDataObject, dataObject); + return ShellObjectCreatorInit<CIDLDataObj>(hwndOwner, pMyPidl, apidl, cidl, IID_PPV_ARG(IDataObject, dataObject)); } /************************************************************************* Modified: trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.cpp [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -311,7 +311,7 @@ */ HRESULT WINAPI CControlPanelFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) { - return ShellObjectCreatorInit<CControlPanelEnum>(dwFlags, IID_IEnumIDList, ppEnumIDList); + return ShellObjectCreatorInit<CControlPanelEnum>(dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList)); } /************************************************************************** Modified: trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.h [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -96,7 +96,6 @@ CCPLItemMenu(); ~CCPLItemMenu(); HRESULT WINAPI Initialize(UINT cidl, PCUITEMID_CHILD_ARRAY apidl); - HRESULT WINAPI FinalConstruct(); // IContextMenu virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); Modified: trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -441,7 +441,7 @@ */ HRESULT WINAPI CDesktopFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) { - return ShellObjectCreatorInit<CDesktopFolderEnum>(this, hwndOwner, dwFlags, IID_IEnumIDList, ppEnumIDList); + return ShellObjectCreatorInit<CDesktopFolderEnum>(this, hwndOwner, dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList)); } /************************************************************************** Modified: trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -377,7 +377,7 @@ */ HRESULT WINAPI CDrivesFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) { - return ShellObjectCreatorInit<CDrivesFolderEnum>(hwndOwner, dwFlags, IID_IEnumIDList, ppEnumIDList); + return ShellObjectCreatorInit<CDrivesFolderEnum>(hwndOwner, dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList)); } /************************************************************************** Modified: trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -253,7 +253,7 @@ DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) { - return ShellObjectCreatorInit<CFileSysEnum>(sPathTarget, dwFlags, IID_IEnumIDList, ppEnumIDList); + return ShellObjectCreatorInit<CFileSysEnum>(sPathTarget, dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList)); } /************************************************************************** Modified: trunk/reactos/dll/win32/shell32/folders/CNetFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CNetFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CNetFolder.cpp [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -274,7 +274,7 @@ */ HRESULT WINAPI CNetFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) { - return ShellObjectCreatorInit<CNetFolderEnum>(hwndOwner, dwFlags, IID_IEnumIDList, ppEnumIDList); + return ShellObjectCreatorInit<CNetFolderEnum>(hwndOwner, dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList)); } /************************************************************************** Modified: trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -226,7 +226,7 @@ */ HRESULT WINAPI CPrinterFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList) { - return ShellObjectCreatorInit<CPrintersEnum>(hwndOwner, dwFlags, IID_IEnumIDList, ppEnumIDList); + return ShellObjectCreatorInit<CPrintersEnum>(hwndOwner, dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList)); } /************************************************************************** Modified: trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -488,7 +488,7 @@ HRESULT WINAPI CRecycleBin::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) { - return ShellObjectCreatorInit<CRecycleBinEnum>(dwFlags, IID_IEnumIDList, ppEnumIDList); + return ShellObjectCreatorInit<CRecycleBinEnum>(dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList)); } HRESULT WINAPI CRecycleBin::BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbc, REFIID riid, void **ppv) Modified: trunk/reactos/dll/win32/shell32/shell32.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32.…
============================================================================== --- trunk/reactos/dll/win32/shell32/shell32.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shell32.cpp [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -158,7 +158,7 @@ HRESULT IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, const IID *riidInst, IClassFactory **theFactory) { - return ShellObjectCreatorInit<IDefClFImpl>(lpfnCI, pcRefDll, riidInst, IID_IClassFactory, theFactory); + return ShellObjectCreatorInit<IDefClFImpl>(lpfnCI, pcRefDll, riidInst, IID_PPV_ARG(IClassFactory, theFactory)); } /****************************************************************************** Modified: trunk/reactos/sdk/include/reactos/shellutils.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/reactos/shellu…
============================================================================== --- trunk/reactos/sdk/include/reactos/shellutils.h [iso-8859-1] (original) +++ trunk/reactos/sdk/include/reactos/shellutils.h [iso-8859-1] Fri Apr 14 20:03:46 2017 @@ -213,273 +213,133 @@ return S_OK; } -template<class T, class R> -HRESULT inline ShellObjectCreator(REFIID riid, R ** ppv) -{ - CComPtr<T> obj; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; -ATLTRY(obj = new _CComObject<T>); - if (obj.p == NULL) - return E_OUTOFMEMORY; - hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(ppv)); - if (FAILED(hResult)) - return hResult; - return S_OK; -} - -template<class T, class R> -HRESULT inline ShellObjectCreatorInit(REFIID riid, R ** ppv) -{ - CComPtr<T> obj; - CComPtr<R> result; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY(obj = new _CComObject<T>); - if (obj.p == NULL) - return E_OUTOFMEMORY; - hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result)); - if (FAILED(hResult)) - return hResult; - - hResult = obj->Initialize(); - if (FAILED(hResult)) - return hResult; - - *ppv = result.Detach(); - - return S_OK; +template<class T> +HRESULT inline ShellObjectCreator(REFIID riid, void ** ppv) +{ + _CComObject<T> *pobj; + HRESULT hResult; + + hResult = _CComObject<T>::CreateInstance(&pobj); + if (FAILED(hResult)) + return hResult; + + pobj->AddRef(); /* CreateInstance returns object with 0 ref count */ + + hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv)); + + pobj->Release(); /* In case of failure the object will be released */ + + return hResult; } template<class T> HRESULT inline ShellObjectCreatorInit(REFIID riid, void ** ppv) { - CComPtr<T> obj; - CComPtr<IUnknown> result; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY(obj = new _CComObject<T>); - if (obj.p == NULL) - return E_OUTOFMEMORY; - hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result)); - if (FAILED(hResult)) - return hResult; - - hResult = obj->Initialize(); - if (FAILED(hResult)) - return hResult; - - *ppv = result.Detach(); - - return S_OK; + _CComObject<T> *pobj; + HRESULT hResult; + + hResult = _CComObject<T>::CreateInstance(&pobj); + if (FAILED(hResult)) + return hResult; + + pobj->AddRef(); /* CreateInstance returns object with 0 ref count */ + + hResult = pobj->Initialize(); + + if (SUCCEEDED(hResult)) + hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv)); + + pobj->Release(); /* In case of failure the object will be released */ + + return hResult; } template<class T, class T1> HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, void ** ppv) { - CComPtr<T> obj; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY(obj = new _CComObject<T>); - if (obj.p == NULL) - return E_OUTOFMEMORY; - hResult = obj->QueryInterface(riid, ppv); - if (FAILED(hResult)) - return hResult; - - hResult = obj->Initialize(initArg1); - if (FAILED(hResult)) - return hResult; - - return S_OK; + _CComObject<T> *pobj; + HRESULT hResult; + + hResult = _CComObject<T>::CreateInstance(&pobj); + if (FAILED(hResult)) + return hResult; + + pobj->AddRef(); /* CreateInstance returns object with 0 ref count */ + + hResult = pobj->Initialize(initArg1); + + if (SUCCEEDED(hResult)) + hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv)); + + pobj->Release(); /* In case of failure the object will be released */ + + return hResult; } template<class T, class T1, class T2> HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, REFIID riid, void ** ppv) { - CComPtr<T> obj; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY(obj = new _CComObject<T>); - if (obj.p == NULL) - return E_OUTOFMEMORY; - hResult = obj->QueryInterface(riid, ppv); - if (FAILED(hResult)) - return hResult; - - hResult = obj->Initialize(initArg1, initArg2); - if (FAILED(hResult)) - return hResult; - - return S_OK; + _CComObject<T> *pobj; + HRESULT hResult; + + hResult = _CComObject<T>::CreateInstance(&pobj); + if (FAILED(hResult)) + return hResult; + + pobj->AddRef(); /* CreateInstance returns object with 0 ref count */ + + hResult = pobj->Initialize(initArg1, initArg2); + + if (SUCCEEDED(hResult)) + hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv)); + + pobj->Release(); /* In case of failure the object will be released */ + + return hResult; } template<class T, class T1, class T2, class T3> HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, REFIID riid, void ** ppv) { - CComPtr<T> obj; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY(obj = new _CComObject<T>); - if (obj.p == NULL) - return E_OUTOFMEMORY; - hResult = obj->QueryInterface(riid, ppv); - if (FAILED(hResult)) - return hResult; - - hResult = obj->Initialize(initArg1, initArg2, initArg3); - if (FAILED(hResult)) - return hResult; - - return S_OK; -} - -template<class T, class T1, class R> -HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, R ** ppv) -{ - CComPtr<T> obj; - CComPtr<R> result; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY(obj = new _CComObject<T>); - if (obj.p == NULL) - return E_OUTOFMEMORY; - hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result)); - if (FAILED(hResult)) - return hResult; - - hResult = obj->Initialize(initArg1); - if (FAILED(hResult)) - return hResult; - - *ppv = result.Detach(); - - return S_OK; -} - -template<class T, class T1, class T2, class R> -HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, REFIID riid, R ** ppv) -{ - CComPtr<T> obj; - CComPtr<R> result; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY(obj = new _CComObject<T>); - if (obj.p == NULL) - return E_OUTOFMEMORY; - hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result)); - if (FAILED(hResult)) - return hResult; - - hResult = obj->Initialize(initArg1, initArg2); - if (FAILED(hResult)) - return hResult; - - *ppv = result.Detach(); - - return S_OK; -} - -template<class T, class T1, class T2, class T3, class R> -HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, REFIID riid, R ** ppv) -{ - CComPtr<T> obj; - CComPtr<R> result; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY(obj = new _CComObject<T>); - if (obj.p == NULL) - return E_OUTOFMEMORY; - hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result)); - if (FAILED(hResult)) - return hResult; - - hResult = obj->Initialize(initArg1, initArg2, initArg3); - if (FAILED(hResult)) - return hResult; - - *ppv = result.Detach(); - - return S_OK; -} - -template<class T, class T1, class T2, class T3, class T4, class R> -HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4 initArg4, REFIID riid, R ** ppv) -{ - CComPtr<T> obj; - CComPtr<R> result; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY(obj = new _CComObject<T>); - if (obj.p == NULL) - return E_OUTOFMEMORY; - hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result)); - if (FAILED(hResult)) - return hResult; - - hResult = obj->Initialize(initArg1, initArg2, initArg3, initArg4); - if (FAILED(hResult)) - return hResult; - - *ppv = result.Detach(); - - return S_OK; -} - -template<class T, class T1, class T2, class T3, class T4, class T5, class R> -HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4 initArg4, T5 initArg5, REFIID riid, R ** ppv) -{ - CComPtr<T> obj; - CComPtr<R> result; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY(obj = new _CComObject<T>); - if (obj.p == NULL) - return E_OUTOFMEMORY; - hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result)); - if (FAILED(hResult)) - return hResult; - - hResult = obj->Initialize(initArg1, initArg2, initArg3, initArg4, initArg5); - if (FAILED(hResult)) - return hResult; - - *ppv = result.Detach(); - - return S_OK; + _CComObject<T> *pobj; + HRESULT hResult; + + hResult = _CComObject<T>::CreateInstance(&pobj); + if (FAILED(hResult)) + return hResult; + + pobj->AddRef(); /* CreateInstance returns object with 0 ref count */ + + hResult = pobj->Initialize(initArg1, initArg2, initArg3); + + if (SUCCEEDED(hResult)) + hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv)); + + pobj->Release(); /* In case of failure the object will be released */ + + return hResult; +} + +template<class T, class T1, class T2, class T3, class T4> +HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4 initArg4, REFIID riid, void ** ppv) +{ + _CComObject<T> *pobj; + HRESULT hResult; + + hResult = _CComObject<T>::CreateInstance(&pobj); + if (FAILED(hResult)) + return hResult; + + pobj->AddRef(); /* CreateInstance returns object with 0 ref count */ + + hResult = pobj->Initialize(initArg1, initArg2, initArg3, initArg4); + + if (SUCCEEDED(hResult)) + hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv)); + + pobj->Release(); /* In case of failure the object will be released */ + + return hResult; } HRESULT inline SHSetStrRet(LPSTRRET pStrRet, LPCSTR pstrValue)
7 years, 8 months
1
0
0
0
[mjansen] 74313: [WIN32SS] Fix charset in font enumeration. Patch by Katayama Hirofumi MZ. CORE-10876
by mjansen@svn.reactos.org
Author: mjansen Date: Fri Apr 14 18:32:07 2017 New Revision: 74313 URL:
http://svn.reactos.org/svn/reactos?rev=74313&view=rev
Log: [WIN32SS] Fix charset in font enumeration. Patch by Katayama Hirofumi MZ. CORE-10876 Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/freetype…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] Fri Apr 14 18:32:07 2017 @@ -2225,7 +2225,6 @@ { return; } - Info->EnumLogFontEx.elfLogFont.lfCharSet = DEFAULT_CHARSET; Info->EnumLogFontEx.elfScript[0] = UNICODE_NULL; IntLockFreeType; @@ -2286,7 +2285,6 @@ } if (DEFAULT_CHARSET != CharSetInfo.ciCharset) { - Info->EnumLogFontEx.elfLogFont.lfCharSet = CharSetInfo.ciCharset; if (ElfScripts[i]) wcscpy(Info->EnumLogFontEx.elfScript, ElfScripts[i]); else
7 years, 8 months
1
0
0
0
[mjansen] 74312: [WIN32SS] Initial fixes for localized font enumeration. Patch by Katayama Hirofumi MZ. CORE-10876
by mjansen@svn.reactos.org
Author: mjansen Date: Fri Apr 14 18:30:57 2017 New Revision: 74312 URL:
http://svn.reactos.org/svn/reactos?rev=74312&view=rev
Log: [WIN32SS] Initial fixes for localized font enumeration. Patch by Katayama Hirofumi MZ. CORE-10876 Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/freetype…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] Fri Apr 14 18:30:57 2017 @@ -48,6 +48,7 @@ #define gmxWorldToDeviceDefault gmxWorldToPageDefault FT_Library library; +static const WORD gusEnglishUS = MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US); /* special font names */ static const UNICODE_STRING MarlettW = RTL_CONSTANT_STRING(L"Marlett"); @@ -2041,30 +2042,40 @@ } static NTSTATUS -IntGetFontLocalizedName(PUNICODE_STRING pLocalNameW, FT_Face Face) +IntGetFontLocalizedName(PUNICODE_STRING pNameW, FT_Face Face, + FT_UShort NameID, FT_UShort LangID) { FT_SfntName Name; INT i, Count; - WCHAR Buf[LF_FACESIZE]; + WCHAR Buf[LF_FULLFACESIZE]; + FT_Error Error; NTSTATUS Status = STATUS_NOT_FOUND; - - RtlInitUnicodeString(pLocalNameW, NULL); + ANSI_STRING AnsiName; + + RtlInitUnicodeString(pNameW, NULL); Count = FT_Get_Sfnt_Name_Count(Face); for (i = 0; i < Count; ++i) { - FT_Get_Sfnt_Name(Face, i, &Name); + Error = FT_Get_Sfnt_Name(Face, i, &Name); + if (Error) + continue; + if (Name.platform_id != TT_PLATFORM_MICROSOFT || Name.encoding_id != TT_MS_ID_UNICODE_CS) { continue; /* not Microsoft Unicode name */ } - if (Name.name_id != TT_NAME_ID_FONT_FAMILY || - Name.string == NULL || Name.string_len == 0 || + if (Name.name_id != NameID || Name.language_id != LangID) + { + continue; /* mismatched */ + } + + if (Name.string == NULL || Name.string_len == 0 || (Name.string[0] == 0 && Name.string[1] == 0)) { - continue; /* not family name */ + continue; /* invalid string */ } if (sizeof(Buf) < Name.string_len + sizeof(UNICODE_NULL)) @@ -2078,12 +2089,22 @@ /* Convert UTF-16 big endian to little endian */ SwapEndian(Buf, Name.string_len); -#if 0 - DPRINT("IntGetFontLocalizedName: %S (%d)\n", Buf, Name.string_len); -#endif - - Status = RtlCreateUnicodeString(pLocalNameW, Buf); + + Status = RtlCreateUnicodeString(pNameW, Buf); break; + } + + if (Status == STATUS_NOT_FOUND) + { + if (LangID != gusEnglishUS) + { + Status = IntGetFontLocalizedName(pNameW, Face, NameID, gusEnglishUS); + } + } + if (Status == STATUS_NOT_FOUND) + { + RtlInitAnsiString(&AnsiName, Face->family_name); + Status = RtlAnsiStringToUnicodeString(pNameW, &AnsiName, TRUE); } return Status; @@ -2167,30 +2188,10 @@ ExFreePoolWithTag(Otm, GDITAG_TEXT); - /* try the localized name */ - status = STATUS_UNSUCCESSFUL; - if (CharSetFromLangID(gusLanguageID) == FontGDI->CharSet) - { - /* get localized name */ - UNICODE_STRING LocalNameW; - status = IntGetFontLocalizedName(&LocalNameW, Face); - if (NT_SUCCESS(status)) - { - /* store it */ - RtlStringCbCopyW(Info->EnumLogFontEx.elfLogFont.lfFaceName, - sizeof(Info->EnumLogFontEx.elfLogFont.lfFaceName), - LocalNameW.Buffer); - RtlStringCbCopyW(Info->EnumLogFontEx.elfFullName, - sizeof(Info->EnumLogFontEx.elfFullName), - LocalNameW.Buffer); - } - RtlFreeUnicodeString(&LocalNameW); - } - - /* if localized name was unavailable */ - if (!NT_SUCCESS(status)) - { - /* store English name */ + /* face name */ + /* TODO: full name */ + if (FaceName) + { RtlStringCbCopyW(Info->EnumLogFontEx.elfLogFont.lfFaceName, sizeof(Info->EnumLogFontEx.elfLogFont.lfFaceName), FaceName); @@ -2198,6 +2199,23 @@ sizeof(Info->EnumLogFontEx.elfFullName), FaceName); } + else + { + UNICODE_STRING NameW; + status = IntGetFontLocalizedName(&NameW, Face, TT_NAME_ID_FONT_FAMILY, + gusLanguageID); + if (NT_SUCCESS(status)) + { + /* store it */ + RtlStringCbCopyW(Info->EnumLogFontEx.elfLogFont.lfFaceName, + sizeof(Info->EnumLogFontEx.elfLogFont.lfFaceName), + NameW.Buffer); + RtlStringCbCopyW(Info->EnumLogFontEx.elfFullName, + sizeof(Info->EnumLogFontEx.elfFullName), + NameW.Buffer); + RtlFreeUnicodeString(&NameW); + } + } RtlInitAnsiString(&StyleA, Face->style_name); StyleW.Buffer = Info->EnumLogFontEx.elfStyle; @@ -2207,19 +2225,9 @@ { return; } - if (StyleW.Length) - { - if (wcslen(Info->EnumLogFontEx.elfFullName) + - StyleW.Length / sizeof(WCHAR) + 1 <= - sizeof(Info->EnumLogFontEx.elfFullName)) - { - wcscat(Info->EnumLogFontEx.elfFullName, L" "); - wcscat(Info->EnumLogFontEx.elfFullName, StyleW.Buffer); - } - } - Info->EnumLogFontEx.elfLogFont.lfCharSet = DEFAULT_CHARSET; - Info->EnumLogFontEx.elfScript[0] = L'\0'; + Info->EnumLogFontEx.elfScript[0] = UNICODE_NULL; + IntLockFreeType; pOS2 = FT_Get_Sfnt_Table(Face, ft_sfnt_os2); @@ -3917,6 +3925,7 @@ LONG Long; BOOL fFixedSys = FALSE, fNeedScaling = FALSE; const BYTE UserCharSet = CharSetFromLangID(gusLanguageID); + NTSTATUS Status; /* FIXME: Aspect Penalty 30 */ /* FIXME: IntSizeSynth Penalty 20 */ @@ -4052,32 +4061,58 @@ if (RequestedNameW->Buffer[0]) { - if (RtlEqualUnicodeString(RequestedNameW, FullFaceNameW, TRUE)) - { - /* matched with full face name */ - } - else if (RtlEqualUnicodeString(RequestedNameW, ActualNameW, TRUE)) - { - /* matched with actual name */ - } - else - { - /* try the localized name */ - UNICODE_STRING LocalNameW; - FT_Face Face = FontGDI->SharedFace->Face; - IntGetFontLocalizedName(&LocalNameW, Face); - if (RtlEqualUnicodeString(RequestedNameW, &LocalNameW, TRUE)) - { - /* matched with localizied name */ - } - else - { - /* FaceName Penalty 10000 */ - /* Requested a face name, but the candidate's face name - does not match. */ - Penalty += 10000; - } - RtlFreeUnicodeString(&LocalNameW); + BOOL Found = FALSE; + FT_Face Face = FontGDI->SharedFace->Face; + + /* localized family name */ + if (!Found) + { + Status = IntGetFontLocalizedName(ActualNameW, Face, TT_NAME_ID_FONT_FAMILY, + gusLanguageID); + if (NT_SUCCESS(Status)) + { + Found = RtlEqualUnicodeString(RequestedNameW, ActualNameW, TRUE); + } + } + /* localized full name */ + if (!Found) + { + Status = IntGetFontLocalizedName(ActualNameW, Face, TT_NAME_ID_FULL_NAME, + gusLanguageID); + if (NT_SUCCESS(Status)) + { + Found = RtlEqualUnicodeString(RequestedNameW, ActualNameW, TRUE); + } + } + if (gusLanguageID != gusEnglishUS) + { + /* English family name */ + if (!Found) + { + Status = IntGetFontLocalizedName(ActualNameW, Face, TT_NAME_ID_FONT_FAMILY, + gusEnglishUS); + if (NT_SUCCESS(Status)) + { + Found = RtlEqualUnicodeString(RequestedNameW, ActualNameW, TRUE); + } + } + /* English full name */ + if (!Found) + { + Status = IntGetFontLocalizedName(ActualNameW, Face, TT_NAME_ID_FULL_NAME, + gusEnglishUS); + if (NT_SUCCESS(Status)) + { + Found = RtlEqualUnicodeString(RequestedNameW, ActualNameW, TRUE); + } + } + } + if (!Found) + { + /* FaceName Penalty 10000 */ + /* Requested a face name, but the candidate's face name + does not match. */ + Penalty += 10000; } }
7 years, 8 months
1
0
0
0
[rnaumann] 74311: [EXPLORER] Addendum to r74307: Fix copypasta CORE-11498
by rnaumann@svn.reactos.org
Author: rnaumann Date: Fri Apr 14 18:25:05 2017 New Revision: 74311 URL:
http://svn.reactos.org/svn/reactos?rev=74311&view=rev
Log: [EXPLORER] Addendum to r74307: Fix copypasta CORE-11498 Modified: trunk/reactos/base/shell/explorer/trayprop.cpp Modified: trunk/reactos/base/shell/explorer/trayprop.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/traypr…
============================================================================== --- trunk/reactos/base/shell/explorer/trayprop.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/trayprop.cpp [iso-8859-1] Fri Apr 14 18:25:05 2017 @@ -240,14 +240,14 @@ pPropInfo->hTaskbarWnd = hwnd; - CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bLock ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bAutoHide ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bAlwaysOnTop ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bGroupButtons ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bShowQuickLaunch ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bShowClock ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TASKBARPROP_LOCK, TaskBarSettings.bLock ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TASKBARPROP_HIDE, TaskBarSettings.bAutoHide ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TASKBARPROP_ONTOP, TaskBarSettings.bAlwaysOnTop ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TASKBARPROP_GROUP, TaskBarSettings.bGroupButtons ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TASKBARPROP_SHOWQL, TaskBarSettings.bShowQuickLaunch ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TASKBARPROP_CLOCK, TaskBarSettings.bShowClock ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bShowSeconds ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bHideInactiveIcons ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TASKBARPROP_HIDEICONS, TaskBarSettings.bHideInactiveIcons ? BST_CHECKED : BST_UNCHECKED); UpdateBitmaps(pPropInfo); }
7 years, 8 months
1
0
0
0
[mjansen] 74310: [WIN32SS] Count number of faces added instead of fonts in IntGdiLoadFontsFromMemory. This fixes displaying embedded fonts in firefox. CORE-13046 CORE-13056
by mjansen@svn.reactos.org
Author: mjansen Date: Fri Apr 14 18:24:44 2017 New Revision: 74310 URL:
http://svn.reactos.org/svn/reactos?rev=74310&view=rev
Log: [WIN32SS] Count number of faces added instead of fonts in IntGdiLoadFontsFromMemory. This fixes displaying embedded fonts in firefox. CORE-13046 CORE-13056 Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/freetype…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] Fri Apr 14 18:24:44 2017 @@ -771,7 +771,7 @@ FT_Face Face; ANSI_STRING AnsiFaceName; FT_WinFNT_HeaderRec WinFNT; - INT FontCount = 0, CharSetCount = 0; + INT FaceCount = 0, CharSetCount = 0; PUNICODE_STRING pFileName = pLoadFont->pFileName; DWORD Characteristics = pLoadFont->Characteristics; PUNICODE_STRING pValueName = &pLoadFont->RegValueName; @@ -971,7 +971,7 @@ FontGDI->CharSet = SYMBOL_CHARSET; } - ++FontCount; + ++FaceCount; DPRINT("Font loaded: %s (%s)\n", Face->family_name, Face->style_name); DPRINT("Num glyphs: %d\n", Face->num_glyphs); DPRINT("CharSet: %d\n", FontGDI->CharSet); @@ -1006,7 +1006,7 @@ FT_Long i; for (i = 1; i < TrueType->ttc_header.count; ++i) { - FontCount += IntGdiLoadFontsFromMemory(pLoadFont, NULL, i, -1); + FaceCount += IntGdiLoadFontsFromMemory(pLoadFont, NULL, i, -1); } } } @@ -1042,11 +1042,12 @@ for (i = 1; i < CharSetCount; ++i) { - FontCount += IntGdiLoadFontsFromMemory(pLoadFont, SharedFace, FontIndex, i); - } - } - - return FontCount; /* number of loaded fonts */ + /* Do not count charsets towards 'faces' loaded */ + IntGdiLoadFontsFromMemory(pLoadFont, SharedFace, FontIndex, i); + } + } + + return FaceCount; /* number of loaded faces */ } /* @@ -1172,7 +1173,7 @@ { GDI_LOAD_FONT LoadFont; FONT_ENTRY_COLL_MEM* EntryCollection; - INT FontCount; + INT FaceCount; HANDLE Ret = 0; PVOID BufferCopy = ExAllocatePoolWithTag(PagedPool, dwSize, TAG_FONT); @@ -1190,7 +1191,7 @@ RtlInitUnicodeString(&LoadFont.RegValueName, NULL); LoadFont.IsTrueType = FALSE; LoadFont.PrivateEntry = NULL; - FontCount = IntGdiLoadFontsFromMemory(&LoadFont, NULL, -1, -1); + FaceCount = IntGdiLoadFontsFromMemory(&LoadFont, NULL, -1, -1); RtlFreeUnicodeString(&LoadFont.RegValueName); @@ -1199,7 +1200,7 @@ SharedMem_Release(LoadFont.Memory); IntUnLockFreeType; - if (FontCount > 0) + if (FaceCount > 0) { EntryCollection = ExAllocatePoolWithTag(PagedPool, sizeof(FONT_ENTRY_COLL_MEM), TAG_FONT); if (EntryCollection) @@ -1213,7 +1214,7 @@ Ret = (HANDLE)EntryCollection->Handle; } } - *pNumAdded = FontCount; + *pNumAdded = FaceCount; return Ret; }
7 years, 8 months
1
0
0
0
[mjansen] 74309: [WIN32SS] Cleanup fonts at process destruction + implement font memory reference counting. Thanks to everyone involved in reviewing this code! (See CR-112) CORE-13056
by mjansen@svn.reactos.org
Author: mjansen Date: Fri Apr 14 18:22:57 2017 New Revision: 74309 URL:
http://svn.reactos.org/svn/reactos?rev=74309&view=rev
Log: [WIN32SS] Cleanup fonts at process destruction + implement font memory reference counting. Thanks to everyone involved in reviewing this code! (See CR-112) CORE-13056 Added: trunk/rostests/apitests/gdi32/Shadows_Into_Light.ttf (with props) trunk/rostests/apitests/gdi32/TTCTestV.ttc (with props) Modified: trunk/reactos/win32ss/gdi/eng/engobjects.h trunk/reactos/win32ss/gdi/ntgdi/font.h trunk/reactos/win32ss/gdi/ntgdi/freetype.c trunk/reactos/win32ss/gdi/ntgdi/init.c trunk/reactos/win32ss/gdi/ntgdi/text.h trunk/rostests/apitests/gdi32/AddFontMemResourceEx.c trunk/rostests/apitests/gdi32/resource.rc Modified: trunk/reactos/win32ss/gdi/eng/engobjects.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/engobjects…
============================================================================== --- trunk/reactos/win32ss/gdi/eng/engobjects.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/engobjects.h [iso-8859-1] Fri Apr 14 18:22:57 2017 @@ -107,9 +107,17 @@ ULONG Dummy; } FLOATGDI; +typedef struct _SHARED_MEM { + PVOID Buffer; + ULONG BufferSize; + BOOL IsMapping; + LONG RefCount; +} SHARED_MEM, *PSHARED_MEM; + typedef struct _SHARED_FACE { - FT_Face Face; - LONG RefCount; + FT_Face Face; + LONG RefCount; + PSHARED_MEM Memory; } SHARED_FACE, *PSHARED_FACE; typedef struct _FONTGDI { Modified: trunk/reactos/win32ss/gdi/ntgdi/font.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/font.h?r…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/font.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/font.h [iso-8859-1] Fri Apr 14 18:22:57 2017 @@ -54,8 +54,7 @@ typedef struct GDI_LOAD_FONT { PUNICODE_STRING pFileName; - PVOID Buffer; - ULONG BufferSize; + PSHARED_MEM Memory; DWORD Characteristics; UNICODE_STRING RegValueName; BOOL IsTrueType; Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/freetype…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] Fri Apr 14 18:22:57 2017 @@ -58,39 +58,6 @@ static UNICODE_STRING FontRegPath = RTL_CONSTANT_STRING(L"\\REGISTRY\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"); -static PSHARED_FACE -SharedFace_Create(FT_Face Face) -{ - PSHARED_FACE Ptr; - Ptr = ExAllocatePoolWithTag(PagedPool, sizeof(SHARED_FACE), TAG_FONT); - if (Ptr) - { - Ptr->Face = Face; - Ptr->RefCount = 1; - } - return Ptr; -} - -static void -SharedFace_AddRef(PSHARED_FACE Ptr) -{ - ++Ptr->RefCount; -} - -static void -SharedFace_Release(PSHARED_FACE Ptr) -{ - if (Ptr->RefCount <= 0) - return; - - --Ptr->RefCount; - if (Ptr->RefCount == 0) - { - FT_Done_Face(Ptr->Face); - ExFreePoolWithTag(Ptr, TAG_FONT); - } -} - /* The FreeType library is not thread safe, so we have to serialize access to it */ @@ -106,11 +73,17 @@ #define IntUnLockGlobalFonts \ ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(FontListLock) +#define ASSERT_GLOBALFONTS_LOCK_HELD() \ + ASSERT(FreeTypeLock->Owner == KeGetCurrentThread()) + #define IntLockFreeType \ ExEnterCriticalRegionAndAcquireFastMutexUnsafe(FreeTypeLock) #define IntUnLockFreeType \ ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(FreeTypeLock) + +#define ASSERT_FREETYPE_LOCK_HELD() \ + ASSERT(FreeTypeLock->Owner == KeGetCurrentThread()) #define MAX_FONT_CACHE 256 @@ -188,6 +161,129 @@ /* list head */ static RTL_STATIC_LIST_HEAD(FontSubstListHead); + +static void +SharedMem_AddRef(PSHARED_MEM Ptr) +{ + ASSERT_FREETYPE_LOCK_HELD(); + + ++Ptr->RefCount; +} + +static PSHARED_FACE +SharedFace_Create(FT_Face Face, PSHARED_MEM Memory) +{ + PSHARED_FACE Ptr; + Ptr = ExAllocatePoolWithTag(PagedPool, sizeof(SHARED_FACE), TAG_FONT); + if (Ptr) + { + Ptr->Face = Face; + Ptr->RefCount = 1; + Ptr->Memory = Memory; + SharedMem_AddRef(Memory); + DPRINT("Creating SharedFace for %s\n", Face->family_name); + } + return Ptr; +} + +static PSHARED_MEM +SharedMem_Create(PBYTE Buffer, ULONG BufferSize, BOOL IsMapping) +{ + PSHARED_MEM Ptr; + Ptr = ExAllocatePoolWithTag(PagedPool, sizeof(SHARED_MEM), TAG_FONT); + if (Ptr) + { + Ptr->Buffer = Buffer; + Ptr->BufferSize = BufferSize; + Ptr->RefCount = 1; + Ptr->IsMapping = IsMapping; + DPRINT("Creating SharedMem for %p (%i, %p)\n", Buffer, IsMapping, Ptr); + } + return Ptr; +} + +static void +SharedFace_AddRef(PSHARED_FACE Ptr) +{ + ASSERT_FREETYPE_LOCK_HELD(); + + ++Ptr->RefCount; +} + +static void +RemoveCachedEntry(PFONT_CACHE_ENTRY Entry) +{ + ASSERT_FREETYPE_LOCK_HELD(); + + FT_Done_Glyph((FT_Glyph)Entry->BitmapGlyph); + RemoveEntryList(&Entry->ListEntry); + ExFreePoolWithTag(Entry, TAG_FONT); + FontCacheNumEntries--; + ASSERT(FontCacheNumEntries <= MAX_FONT_CACHE); +} + +static void +RemoveCacheEntries(FT_Face Face) +{ + PLIST_ENTRY CurrentEntry; + PFONT_CACHE_ENTRY FontEntry; + + ASSERT_FREETYPE_LOCK_HELD(); + + CurrentEntry = FontCacheListHead.Flink; + while (CurrentEntry != &FontCacheListHead) + { + FontEntry = CONTAINING_RECORD(CurrentEntry, FONT_CACHE_ENTRY, ListEntry); + CurrentEntry = CurrentEntry->Flink; + + if (FontEntry->Face == Face) + { + RemoveCachedEntry(FontEntry); + } + } +} + +static void SharedMem_Release(PSHARED_MEM Ptr) +{ + ASSERT_FREETYPE_LOCK_HELD(); + ASSERT(Ptr->RefCount > 0); + + if (Ptr->RefCount <= 0) + return; + + --Ptr->RefCount; + if (Ptr->RefCount == 0) + { + DPRINT("Releasing SharedMem for %p (%i, %p)\n", Ptr->Buffer, Ptr->IsMapping, Ptr); + if (Ptr->IsMapping) + MmUnmapViewInSystemSpace(Ptr->Buffer); + else + ExFreePoolWithTag(Ptr->Buffer, TAG_FONT); + ExFreePoolWithTag(Ptr, TAG_FONT); + } +} + +static void +SharedFace_Release(PSHARED_FACE Ptr) +{ + IntLockFreeType; + ASSERT(Ptr->RefCount > 0); + + if (Ptr->RefCount <= 0) + return; + + --Ptr->RefCount; + if (Ptr->RefCount == 0) + { + DPRINT("Releasing SharedFace for %s\n", Ptr->Face->family_name); + RemoveCacheEntries(Ptr->Face); + FT_Done_Face(Ptr->Face); + SharedMem_Release(Ptr->Memory); + ExFreePoolWithTag(Ptr, TAG_FONT); + } + IntUnLockFreeType; +} + /* * IntLoadFontSubstList --- loads the list of font substitutes @@ -677,8 +773,6 @@ FT_WinFNT_HeaderRec WinFNT; INT FontCount = 0, CharSetCount = 0; PUNICODE_STRING pFileName = pLoadFont->pFileName; - PVOID Buffer = pLoadFont->Buffer; - ULONG BufferSize = pLoadFont->BufferSize; DWORD Characteristics = pLoadFont->Characteristics; PUNICODE_STRING pValueName = &pLoadFont->RegValueName; TT_OS2 * pOS2; @@ -693,30 +787,37 @@ IntLockFreeType; Error = FT_New_Memory_Face( library, - Buffer, - BufferSize, + pLoadFont->Memory->Buffer, + pLoadFont->Memory->BufferSize, ((FontIndex != -1) ? FontIndex : 0), &Face); + + if (!Error) + SharedFace = SharedFace_Create(Face, pLoadFont->Memory); + IntUnLockFreeType; if (FT_IS_SFNT(Face)) pLoadFont->IsTrueType = TRUE; - if (!Error) - SharedFace = SharedFace_Create(Face); if (Error || SharedFace == NULL) { + if (SharedFace) + SharedFace_Release(SharedFace); + if (Error == FT_Err_Unknown_File_Format) DPRINT1("Unknown font file format\n"); else - DPRINT1("Error reading font file (error code: %d)\n", Error); + DPRINT1("Error reading font (error code: %d)\n", Error); return 0; /* failure */ } } else { Face = SharedFace->Face; + IntLockFreeType; SharedFace_AddRef(SharedFace); + IntUnLockFreeType; } /* allocate a FONT_ENTRY */ @@ -1006,8 +1107,7 @@ } LoadFont.pFileName = FileName; - LoadFont.Buffer = Buffer; - LoadFont.BufferSize = ViewSize; + LoadFont.Memory = SharedMem_Create(Buffer, ViewSize, TRUE); LoadFont.Characteristics = Characteristics; RtlInitUnicodeString(&LoadFont.RegValueName, NULL); LoadFont.IsTrueType = FALSE; @@ -1015,6 +1115,11 @@ FontCount = IntGdiLoadFontsFromMemory(&LoadFont, NULL, -1, -1); ObDereferenceObject(SectionObject); + + /* Release our copy */ + IntLockFreeType; + SharedMem_Release(LoadFont.Memory); + IntUnLockFreeType; if (FontCount > 0) { @@ -1070,17 +1175,17 @@ INT FontCount; HANDLE Ret = 0; - /* We leak this buffer for now, same as all fonts do with their buffer! */ - LoadFont.Buffer = ExAllocatePoolWithTag(PagedPool, dwSize, TAG_FONT); - if (!LoadFont.Buffer) + PVOID BufferCopy = ExAllocatePoolWithTag(PagedPool, dwSize, TAG_FONT); + + if (!BufferCopy) { *pNumAdded = 0; return NULL; } - memcpy(LoadFont.Buffer, Buffer, dwSize); + memcpy(BufferCopy, Buffer, dwSize); LoadFont.pFileName = NULL; - LoadFont.BufferSize = dwSize; + LoadFont.Memory = SharedMem_Create(BufferCopy, dwSize, FALSE); LoadFont.Characteristics = FR_PRIVATE | FR_NOT_ENUM; RtlInitUnicodeString(&LoadFont.RegValueName, NULL); LoadFont.IsTrueType = FALSE; @@ -1089,7 +1194,11 @@ RtlFreeUnicodeString(&LoadFont.RegValueName); - *pNumAdded = FontCount; + /* Release our copy */ + IntLockFreeType; + SharedMem_Release(LoadFont.Memory); + IntUnLockFreeType; + if (FontCount > 0) { EntryCollection = ExAllocatePoolWithTag(PagedPool, sizeof(FONT_ENTRY_COLL_MEM), TAG_FONT); @@ -1104,11 +1213,26 @@ Ret = (HANDLE)EntryCollection->Handle; } } + *pNumAdded = FontCount; return Ret; } // FIXME: Add RemoveFontResource + +static VOID FASTCALL +CleanupFontEntry(PFONT_ENTRY FontEntry) +{ + PFONTGDI FontGDI = FontEntry->Font; + PSHARED_FACE SharedFace = FontGDI->SharedFace; + + if (FontGDI->Filename) + ExFreePoolWithTag(FontGDI->Filename, GDITAG_PFF); + + EngFreeMem(FontGDI); + SharedFace_Release(SharedFace); + ExFreePoolWithTag(FontEntry, TAG_FONT); +} VOID FASTCALL IntGdiCleanupMemEntry(PFONT_ENTRY_MEM Head) @@ -1121,12 +1245,29 @@ Entry = RemoveHeadList(&Head->ListEntry); FontEntry = CONTAINING_RECORD(Entry, FONT_ENTRY_MEM, ListEntry); - // Delete FontEntry->Entry (FONT_ENTRY*) + CleanupFontEntry(FontEntry->Entry); ExFreePoolWithTag(FontEntry, TAG_FONT); } - // Delete Head->Entry (FONT_ENTRY*) + CleanupFontEntry(Head->Entry); ExFreePoolWithTag(Head, TAG_FONT); +} + +static VOID FASTCALL +UnlinkFontMemCollection(PFONT_ENTRY_COLL_MEM Collection) +{ + PFONT_ENTRY_MEM FontMemEntry = Collection->Entry; + PLIST_ENTRY ListEntry; + RemoveEntryList(&Collection->ListEntry); + + do { + /* Also unlink the FONT_ENTRY stuff from the PrivateFontListHead */ + RemoveEntryList(&FontMemEntry->Entry->ListEntry); + + ListEntry = FontMemEntry->ListEntry.Flink; + FontMemEntry = CONTAINING_RECORD(ListEntry, FONT_ENTRY_MEM, ListEntry); + + } while (FontMemEntry != Collection->Entry); } BOOL FASTCALL @@ -1146,7 +1287,7 @@ if (CurrentEntry->Handle == (UINT)hMMFont) { EntryCollection = CurrentEntry; - RemoveEntryList(Entry); + UnlinkFontMemCollection(CurrentEntry); break; } @@ -1163,6 +1304,52 @@ return FALSE; } + +VOID FASTCALL +IntGdiCleanupPrivateFontsForProcess(VOID) +{ + PPROCESSINFO Win32Process = PsGetCurrentProcessWin32Process(); + PLIST_ENTRY Entry; + PFONT_ENTRY_COLL_MEM EntryCollection; + + DPRINT("IntGdiCleanupPrivateFontsForProcess()\n"); + do { + Entry = NULL; + EntryCollection = NULL; + + IntLockProcessPrivateFonts(Win32Process); + if (!IsListEmpty(&Win32Process->PrivateMemFontListHead)) + { + Entry = Win32Process->PrivateMemFontListHead.Flink; + EntryCollection = CONTAINING_RECORD(Entry, FONT_ENTRY_COLL_MEM, ListEntry); + UnlinkFontMemCollection(EntryCollection); + } + IntUnLockProcessPrivateFonts(Win32Process); + + if (EntryCollection) + { + IntGdiCleanupMemEntry(EntryCollection->Entry); + ExFreePoolWithTag(EntryCollection, TAG_FONT); + } + else + { + /* No Mem fonts anymore, see if we have any other private fonts left */ + Entry = NULL; + IntLockProcessPrivateFonts(Win32Process); + if (!IsListEmpty(&Win32Process->PrivateFontListHead)) + { + Entry = RemoveHeadList(&Win32Process->PrivateFontListHead); + } + IntUnLockProcessPrivateFonts(Win32Process); + + if (Entry) + { + CleanupFontEntry(CONTAINING_RECORD(Entry, FONT_ENTRY, ListEntry)); + } + } + + } while (Entry); +} BOOL FASTCALL IntIsFontRenderingEnabled(VOID) @@ -1737,7 +1924,7 @@ Entry = Head->Flink; while (Entry != Head) { - CurrentEntry = (PFONT_ENTRY) CONTAINING_RECORD(Entry, FONT_ENTRY, ListEntry); + CurrentEntry = CONTAINING_RECORD(Entry, FONT_ENTRY, ListEntry); FontGDI = CurrentEntry->Font; ASSERT(FontGDI); @@ -1774,7 +1961,8 @@ PPROCESSINFO Win32Process; PFONTGDI Font; - /* Search the process local list */ + /* Search the process local list. + We do not have to search the 'Mem' list, since those fonts are linked in the PrivateFontListHead */ Win32Process = PsGetCurrentProcessWin32Process(); IntLockProcessPrivateFonts(Win32Process); Font = FindFaceNameInList(FaceName, &Win32Process->PrivateFontListHead); @@ -2333,10 +2521,12 @@ PLIST_ENTRY CurrentEntry; PFONT_CACHE_ENTRY FontEntry; + ASSERT_FREETYPE_LOCK_HELD(); + CurrentEntry = FontCacheListHead.Flink; while (CurrentEntry != &FontCacheListHead) { - FontEntry = (PFONT_CACHE_ENTRY)CurrentEntry; + FontEntry = CONTAINING_RECORD(CurrentEntry, FONT_CACHE_ENTRY, ListEntry); if ((FontEntry->Face == Face) && (FontEntry->GlyphIndex == GlyphIndex) && (FontEntry->Height == Height) && @@ -2412,6 +2602,8 @@ FT_Bitmap AlignedBitmap; FT_BitmapGlyph BitmapGlyph; + ASSERT_FREETYPE_LOCK_HELD(); + error = FT_Get_Glyph(GlyphSlot, &GlyphCopy); if (error) { @@ -2455,13 +2647,10 @@ NewEntry->mxWorldToDevice = *pmx; InsertHeadList(&FontCacheListHead, &NewEntry->ListEntry); - if (FontCacheNumEntries++ > MAX_FONT_CACHE) - { - NewEntry = (PFONT_CACHE_ENTRY)FontCacheListHead.Blink; - FT_Done_Glyph((FT_Glyph)NewEntry->BitmapGlyph); - RemoveTailList(&FontCacheListHead); - ExFreePoolWithTag(NewEntry, TAG_FONT); - FontCacheNumEntries--; + if (++FontCacheNumEntries > MAX_FONT_CACHE) + { + NewEntry = CONTAINING_RECORD(FontCacheListHead.Blink, FONT_CACHE_ENTRY, ListEntry); + RemoveCachedEntry(NewEntry); } return BitmapGlyph; @@ -4116,7 +4305,7 @@ Entry = Head->Flink; while (Entry != Head) { - CurrentEntry = (PFONT_ENTRY) CONTAINING_RECORD(Entry, FONT_ENTRY, ListEntry); + CurrentEntry = CONTAINING_RECORD(Entry, FONT_ENTRY, ListEntry); FontGDI = CurrentEntry->Font; ASSERT(FontGDI); Face = FontGDI->SharedFace->Face; Modified: trunk/reactos/win32ss/gdi/ntgdi/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/init.c?r…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/init.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/init.c [iso-8859-1] Fri Apr 14 18:22:57 2017 @@ -50,6 +50,8 @@ ASSERT(ppiCurrent); ASSERT(ppiCurrent->peProcess == Process); + IntGdiCleanupPrivateFontsForProcess(); + /* And GDI ones too */ GDI_CleanupForProcess(Process); Modified: trunk/reactos/win32ss/gdi/ntgdi/text.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/text.h?r…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/text.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/text.h [iso-8859-1] Fri Apr 14 18:22:57 2017 @@ -112,6 +112,7 @@ VOID FASTCALL IntEnableFontRendering(BOOL Enable); ULONG FASTCALL FontGetObject(PTEXTOBJ TextObj, ULONG Count, PVOID Buffer); VOID FASTCALL IntLoadSystemFonts(VOID); +VOID FASTCALL IntGdiCleanupPrivateFontsForProcess(VOID); INT FASTCALL IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics); HANDLE FASTCALL IntGdiAddFontMemResource(PVOID Buffer, DWORD dwSize, PDWORD pNumAdded); BOOL FASTCALL IntGdiRemoveFontMemResource(HANDLE hMMFont); Modified: trunk/rostests/apitests/gdi32/AddFontMemResourceEx.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/AddFontMem…
============================================================================== --- trunk/rostests/apitests/gdi32/AddFontMemResourceEx.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/AddFontMemResourceEx.c [iso-8859-1] Fri Apr 14 18:22:57 2017 @@ -4,7 +4,9 @@ * PURPOSE: Test for AddFontMemResourceEx * PROGRAMMERS: Mark Jansen * - * PanosePitchTest by Katayama Hirofumi MZ, licensed under CC BY + * PanosePitchTest + TTCTestV by Katayama Hirofumi MZ, licensed under CC BY + * Shadows_Into_Light by Kimberly Geswein, licensed under OFL + * Captured from firefox, embedded on
reactos.org
*/ @@ -12,101 +14,259 @@ #include <wingdi.h> #include <winuser.h> - -static void test_font_caps(HDC hdc) +typedef struct _fnt_res +{ + const char* FontName; + TEXTMETRICA tm; +} fnt_res; + +typedef struct _fnt_test +{ + const char* ResourceName; + int NumFaces; + fnt_res res[4]; +} fnt_test; + + + +static fnt_test test_data[] = +{ + { + .ResourceName = "PanosePitchTest.ttf", + .NumFaces = 2, + .res = + { + { + .FontName = "PanosePitchTest", + .tm.tmHeight = 11, + .tm.tmAscent = 11, + .tm.tmDescent = 0, + .tm.tmInternalLeading = -5, + .tm.tmExternalLeading = 1, + .tm.tmAveCharWidth = 8, + .tm.tmMaxCharWidth = 11, + .tm.tmWeight = FW_NORMAL, + .tm.tmOverhang = 0, + .tm.tmDigitizedAspectX = 96, + .tm.tmDigitizedAspectY = 96, + .tm.tmFirstChar = 63, + .tm.tmLastChar = 65, + .tm.tmDefaultChar = 165, + .tm.tmBreakChar = 65, + .tm.tmItalic = 0, + .tm.tmUnderlined = 0, + .tm.tmStruckOut = 0, + .tm.tmPitchAndFamily = TMPF_TRUETYPE | TMPF_VECTOR, + .tm.tmCharSet = SHIFTJIS_CHARSET, + }, + { + .FontName = "@PanosePitchTest", + .tm.tmHeight = 11, + .tm.tmAscent = 11, + .tm.tmDescent = 0, + .tm.tmInternalLeading = -5, + .tm.tmExternalLeading = 1, + .tm.tmAveCharWidth = 8, + .tm.tmMaxCharWidth = 11, + .tm.tmWeight = FW_NORMAL, + .tm.tmOverhang = 0, + .tm.tmDigitizedAspectX = 96, + .tm.tmDigitizedAspectY = 96, + .tm.tmFirstChar = 63, + .tm.tmLastChar = 65, + .tm.tmDefaultChar = 165, + .tm.tmBreakChar = 65, + .tm.tmItalic = 0, + .tm.tmUnderlined = 0, + .tm.tmStruckOut = 0, + .tm.tmPitchAndFamily = TMPF_TRUETYPE | TMPF_VECTOR, + .tm.tmCharSet = SHIFTJIS_CHARSET, + }, + }, + }, + { + .ResourceName = "TTCTestV.ttc", + .NumFaces = 3, + .res = + { + { + .FontName = "No1Of3in1", + .tm.tmHeight = 12, + .tm.tmAscent = 12, + .tm.tmDescent = 0, + .tm.tmInternalLeading = -4, + .tm.tmExternalLeading = 1, + .tm.tmAveCharWidth = -525, + .tm.tmMaxCharWidth = 6, + .tm.tmWeight = FW_NORMAL, + .tm.tmOverhang = 0, + .tm.tmDigitizedAspectX = 96, + .tm.tmDigitizedAspectY = 96, + .tm.tmFirstChar = 63, + .tm.tmLastChar = 65, + .tm.tmDefaultChar = 64, + .tm.tmBreakChar = 65, + .tm.tmItalic = 0, + .tm.tmUnderlined = 0, + .tm.tmStruckOut = 0, + .tm.tmPitchAndFamily = TMPF_TRUETYPE | TMPF_VECTOR | TMPF_FIXED_PITCH, + .tm.tmCharSet = ANSI_CHARSET, + }, + { + .FontName = "No2Of3in1", + .tm.tmHeight = 12, + .tm.tmAscent = 12, + .tm.tmDescent = 0, + .tm.tmInternalLeading = -4, + .tm.tmExternalLeading = 1, + .tm.tmAveCharWidth = 8, + .tm.tmMaxCharWidth = 7, + .tm.tmWeight = FW_NORMAL, + .tm.tmOverhang = 0, + .tm.tmDigitizedAspectX = 96, + .tm.tmDigitizedAspectY = 96, + .tm.tmFirstChar = 63, + .tm.tmLastChar = 65, + .tm.tmDefaultChar = 64, + .tm.tmBreakChar = 65, + .tm.tmItalic = 0, + .tm.tmUnderlined = 0, + .tm.tmStruckOut = 0, + .tm.tmPitchAndFamily = TMPF_TRUETYPE | TMPF_VECTOR | TMPF_FIXED_PITCH, + .tm.tmCharSet = ANSI_CHARSET, + }, + { + .FontName = "No3Of3in1V", + .tm.tmHeight = 12, + .tm.tmAscent = 12, + .tm.tmDescent = 0, + .tm.tmInternalLeading = -4, + .tm.tmExternalLeading = 1, + .tm.tmAveCharWidth = 8, + .tm.tmMaxCharWidth = 13, + .tm.tmWeight = FW_NORMAL, + .tm.tmOverhang = 0, + .tm.tmDigitizedAspectX = 96, + .tm.tmDigitizedAspectY = 96, + .tm.tmFirstChar = 63, + .tm.tmLastChar = 65, + .tm.tmDefaultChar = 64, + .tm.tmBreakChar = 65, + .tm.tmItalic = 0, + .tm.tmUnderlined = 0, + .tm.tmStruckOut = 0, + .tm.tmPitchAndFamily = FF_MODERN | TMPF_TRUETYPE | TMPF_VECTOR, + .tm.tmCharSet = ANSI_CHARSET, + }, + }, + }, + { + .ResourceName = "Shadows_Into_Light.ttf", + .NumFaces = 1, + .res = + { + { + .FontName = "ufaXaAlLOxCUGYJ7KN51UP2Q==", + .tm.tmHeight = 26, + .tm.tmAscent = 19, + .tm.tmDescent = 7, + .tm.tmInternalLeading = 10, + .tm.tmExternalLeading = 0, + .tm.tmAveCharWidth = 7, + .tm.tmMaxCharWidth = 23, + .tm.tmWeight = FW_NORMAL, + .tm.tmOverhang = 0, + .tm.tmDigitizedAspectX = 96, + .tm.tmDigitizedAspectY = 96, + .tm.tmFirstChar = 30, + .tm.tmLastChar = 255, + .tm.tmDefaultChar = 31, + .tm.tmBreakChar = 32, + .tm.tmItalic = 0, + .tm.tmUnderlined = 0, + .tm.tmStruckOut = 0, + .tm.tmPitchAndFamily = TMPF_TRUETYPE | TMPF_VECTOR | TMPF_FIXED_PITCH, + .tm.tmCharSet = ANSI_CHARSET, + }, + }, + }, +}; + + +#define ok_int2(expression) \ + do { \ + int _value = (expression); \ + ok(_value == (res->expression), "Wrong value for '%s', expected: %d, got: %d for %s/%s\n", \ + #expression, (int)(res->expression), _value, test_name, res->FontName); \ + } while (0) + +#define ok_hex2(expression) \ + do { \ + int _value = (expression); \ + ok(_value == (res->expression), "Wrong value for '%s', expected: 0x%x, got: 0x%x for %s/%s\n", \ + #expression, (int)(res->expression), _value, test_name, res->FontName); \ + } while (0) + + +static void test_font_caps(HDC hdc, int test_index) { HGDIOBJ old; TEXTMETRICA tm = { 0 }; char name[64]; BOOL ret; - HFONT font = CreateFont(0, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET, - OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, TEXT("PanosePitchTest")); - - if (font) - { - old = SelectObject(hdc, font); - - memset(&tm, 0xaa, sizeof(tm)); - ret = GetTextMetricsA(hdc, &tm); - ok_int(ret, TRUE); - - SetLastError(0xdeadbeef); - ret = GetTextFaceA(hdc, sizeof(name), name); - ok(ret, "GetTextFaceA error %lu\n", GetLastError()); - if (ret) - { - ok_str(name, "PanosePitchTest"); + HFONT font; + int n; + const char* test_name = test_data[test_index].ResourceName; + + for (n = 0; test_data[test_index].res[n].FontName; ++n) + { + fnt_res* res = test_data[test_index].res + n; + font = CreateFontA(0, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET, + OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, res->FontName); + + if (font) + { + old = SelectObject(hdc, font); + + memset(&tm, 0xaa, sizeof(tm)); + ret = GetTextMetricsA(hdc, &tm); + ok(ret, "GetTextMetricsA() for %s/%s\n", test_name, res->FontName); + + SetLastError(0xdeadbeef); + ret = GetTextFaceA(hdc, sizeof(name), name); + ok(ret, "GetTextFaceA error %lu for %s/%s\n", GetLastError(), test_name, res->FontName); + if (ret) + { + ok(!strcmp(name, res->FontName), "FontName was %s, expected %s for %s/%s", name, res->FontName, test_name, res->FontName); + } + + ok_int2(tm.tmHeight); + ok_int2(tm.tmAscent); + ok_int2(tm.tmDescent); + ok_int2(tm.tmInternalLeading); + ok_int2(tm.tmExternalLeading); + ok_int2(tm.tmAveCharWidth); + ok_int2(tm.tmMaxCharWidth); + ok_int2(tm.tmWeight); + ok_int2(tm.tmOverhang); + ok_int2(tm.tmDigitizedAspectX); + ok_int2(tm.tmDigitizedAspectY); + ok_int2(tm.tmFirstChar); + ok_int2(tm.tmLastChar); + ok_int2(tm.tmDefaultChar); + ok_int2(tm.tmBreakChar); + ok_int2(tm.tmItalic); + ok_int2(tm.tmUnderlined); + ok_int2(tm.tmStruckOut); + ok_hex2(tm.tmPitchAndFamily); + ok_int2(tm.tmCharSet); + + SelectObject(hdc, old); + DeleteObject(font); } - - ok_int(tm.tmHeight, 11); - ok_int(tm.tmAscent, 11); - ok_int(tm.tmDescent, 0); - ok_int(tm.tmInternalLeading, -5); - ok_int(tm.tmExternalLeading, 1); - ok_int(tm.tmAveCharWidth, 8); - ok_int(tm.tmMaxCharWidth, 11); - ok_int(tm.tmWeight, FW_NORMAL); - ok_int(tm.tmOverhang, 0); - ok_int(tm.tmDigitizedAspectX, 96); - ok_int(tm.tmDigitizedAspectY, 96); - ok_int(tm.tmFirstChar, 63); - ok_int(tm.tmLastChar, 65); - ok_int(tm.tmDefaultChar, 165); - ok_int(tm.tmBreakChar, 65); - ok_int(tm.tmItalic, 0); - ok_int(tm.tmUnderlined, 0); - ok_int(tm.tmStruckOut, 0); - ok_hex(tm.tmPitchAndFamily, TMPF_TRUETYPE | TMPF_VECTOR); - ok_int(tm.tmCharSet, SHIFTJIS_CHARSET); - - SelectObject(hdc, old); - DeleteObject(font); - } - - font = CreateFont(0, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET, - OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, TEXT("@PanosePitchTest")); - - if (font) - { - old = SelectObject(hdc, font); - - memset(&tm, 0xaa, sizeof(tm)); - ret = GetTextMetricsA(hdc, &tm); - ok_int(ret, TRUE); - - SetLastError(0xdeadbeef); - ret = GetTextFaceA(hdc, sizeof(name), name); - ok(ret, "GetTextFaceA error %lu\n", GetLastError()); - if (ret) - { - ok_str(name, "@PanosePitchTest"); - } - - ok_int(tm.tmHeight, 11); - ok_int(tm.tmAscent, 11); - ok_int(tm.tmDescent, 0); - ok_int(tm.tmInternalLeading, -5); - ok_int(tm.tmExternalLeading, 1); - ok_int(tm.tmAveCharWidth, 8); - ok_int(tm.tmMaxCharWidth, 11); - ok_int(tm.tmWeight, FW_NORMAL); - ok_int(tm.tmOverhang, 0); - ok_int(tm.tmDigitizedAspectX, 96); - ok_int(tm.tmDigitizedAspectY, 96); - ok_int(tm.tmFirstChar, 63); - ok_int(tm.tmLastChar, 65); - ok_int(tm.tmDefaultChar, 165); - ok_int(tm.tmBreakChar, 65); - ok_int(tm.tmItalic, 0); - ok_int(tm.tmUnderlined, 0); - ok_int(tm.tmStruckOut, 0); - ok_hex(tm.tmPitchAndFamily, TMPF_TRUETYPE | TMPF_VECTOR); - ok_int(tm.tmCharSet, SHIFTJIS_CHARSET); - - SelectObject(hdc, old); - DeleteObject(font); } } + /* Not working as of 2017-04-08 on ReactOS */ static BOOL is_font_available(HDC hdc, const char* fontName) @@ -122,7 +282,7 @@ SetLastError(0xdeadbeef); ret = GetTextFaceA(hdc, sizeof(name), name); - ok(ret, "GetTextFaceA error %lu\n", GetLastError()); + ok(ret, "GetTextFaceA error %lu for %s\n", GetLastError(), fontName); SelectObject(hdc, old); DeleteObject(font); @@ -145,16 +305,20 @@ LPVOID pFont; HANDLE hFont; + fnt_test* data; + int n; HDC hdc = CreateCompatibleDC(NULL); BOOL is_font_available_broken = is_font_available(hdc, "Nonexisting font name here"); - ok(!is_font_available_broken, "Validating font is broken! (CORE-13053) !\n"); - - if (is_font_available_broken || !is_font_available(hdc, "PanosePitchTest")) - { + ok(!is_font_available_broken, "Validating font is broken! (CORE-13053)!\n"); + + for (n = 0; n < _countof(test_data); ++n) + { + data = test_data + n; + mod = GetModuleHandle(NULL); - hRsrc = FindResource(mod, TEXT("PanosePitchTest.ttf"), MAKEINTRESOURCE(RT_RCDATA)); + hRsrc = FindResourceA(mod, data->ResourceName, MAKEINTRESOURCE(RT_RCDATA)); hTemplate = LoadResource(mod, hRsrc); dwSize = SizeofResource(mod, hRsrc); @@ -162,30 +326,27 @@ dwNumFonts = 0; hFont = AddFontMemResourceEx(pFont, dwSize, NULL, &dwNumFonts); - ok_int(dwNumFonts, 2); - ok(hFont != NULL, "Expected valid handle\n"); + ok(dwNumFonts == data->NumFaces, "dwNumFonts was %lu, expected %d for %s\n", dwNumFonts, data->NumFaces, data->ResourceName); + ok(hFont != NULL, "Expected valid handle for %s\n", data->ResourceName); if (hFont) { - test_font_caps(hdc); + test_font_caps(hdc, n); RemoveFontMemResourceEx(hFont); if (!is_font_available_broken) { - ok (!is_font_available(hdc, "PanosePitchTest"), "Expected font to be unregistered again\n"); + ok (!is_font_available(hdc, data->ResourceName), "Expected font to be unregistered again for %s\n", data->ResourceName); } else { - skip("Font unregister test\n"); + skip("Font unregister test for %s\n", data->ResourceName); } } UnlockResource(hTemplate); FreeResource(hTemplate); } - else - { - skip("Font PanosePitchTest already available\n"); - } + DeleteDC(hdc); } Added: trunk/rostests/apitests/gdi32/Shadows_Into_Light.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/Shadows_In…
============================================================================== Binary file - no diff available. Propchange: trunk/rostests/apitests/gdi32/Shadows_Into_Light.ttf ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/rostests/apitests/gdi32/TTCTestV.ttc URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/TTCTestV.t…
============================================================================== Binary file - no diff available. Propchange: trunk/rostests/apitests/gdi32/TTCTestV.ttc ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Modified: trunk/rostests/apitests/gdi32/resource.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/resource.r…
============================================================================== --- trunk/rostests/apitests/gdi32/resource.rc [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/resource.rc [iso-8859-1] Fri Apr 14 18:22:57 2017 @@ -2,3 +2,5 @@ ReactOSTestTahoma.ttf RCDATA ReactOSTestTahoma.ttf PanosePitchTest.ttf RCDATA PanosePitchTest.ttf +TTCTestV.ttc RCDATA TTCTestV.ttc +Shadows_Into_Light.ttf RCDATA Shadows_Into_Light.ttf
7 years, 8 months
1
0
0
0
[mjansen] 74308: [WIN32SS] Add missing \n to DPRINT1 Spotted by Thomas Schneider.
by mjansen@svn.reactos.org
Author: mjansen Date: Fri Apr 14 18:20:13 2017 New Revision: 74308 URL:
http://svn.reactos.org/svn/reactos?rev=74308&view=rev
Log: [WIN32SS] Add missing \n to DPRINT1 Spotted by Thomas Schneider. Modified: trunk/reactos/win32ss/gdi/eng/pdevobj.c Modified: trunk/reactos/win32ss/gdi/eng/pdevobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/pdevobj.c?…
============================================================================== --- trunk/reactos/win32ss/gdi/eng/pdevobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/pdevobj.c [iso-8859-1] Fri Apr 14 18:20:13 2017 @@ -242,7 +242,7 @@ hsurf = ppdev->pldev->pfn.EnableSurface(ppdev->dhpdev); if (hsurf== NULL) { - DPRINT1("Failed to create PDEV surface!"); + DPRINT1("Failed to create PDEV surface!\n"); return NULL; }
7 years, 8 months
1
0
0
0
[rnaumann] 74307: [EXPLORER] start reworking some code for loading/saving settings implementation CORE-11498 - Rename the settings structure to something more meaningful for using it for all taskba...
by rnaumann@svn.reactos.org
Author: rnaumann Date: Fri Apr 14 18:08:34 2017 New Revision: 74307 URL:
http://svn.reactos.org/svn/reactos?rev=74307&view=rev
Log: [EXPLORER] start reworking some code for loading/saving settings implementation CORE-11498 - Rename the settings structure to something more meaningful for using it for all taskbar related settings - define some default settings - check checkboxes with settings values in the properties window - move saving the settings to an own function which will be implemented later Modified: trunk/reactos/base/shell/explorer/explorer.cpp trunk/reactos/base/shell/explorer/precomp.h trunk/reactos/base/shell/explorer/settings.cpp trunk/reactos/base/shell/explorer/trayntfy.cpp trunk/reactos/base/shell/explorer/trayprop.cpp Modified: trunk/reactos/base/shell/explorer/explorer.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/explor…
============================================================================== --- trunk/reactos/base/shell/explorer/explorer.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/explorer.cpp [iso-8859-1] Fri Apr 14 18:08:34 2017 @@ -132,7 +132,7 @@ hExplorerInstance = hInstance; hProcessHeap = GetProcessHeap(); - LoadAdvancedSettings(); + LoadTaskBarSettings(); InitCommonControls(); OleInitialize(NULL); Modified: trunk/reactos/base/shell/explorer/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/precom…
============================================================================== --- trunk/reactos/base/shell/explorer/precomp.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/precomp.h [iso-8859-1] Fri Apr 14 18:08:34 2017 @@ -176,16 +176,25 @@ */ /* Structure to hold non-default options*/ -typedef struct _ADVANCED_SETTINGS -{ +typedef struct _TASKBAR_SETTINGS +{ + BOOL bLock; + BOOL bAutoHide; + BOOL bAlwaysOnTop; + BOOL bGroupButtons; + BOOL bShowQuickLaunch; + BOOL bShowClock; BOOL bShowSeconds; -} ADVANCED_SETTINGS, *PADVANCED_SETTINGS; - -extern ADVANCED_SETTINGS AdvancedSettings; -extern const TCHAR szAdvancedSettingsKey []; - -VOID -LoadAdvancedSettings(VOID); + BOOL bHideInactiveIcons; +} TASKBAR_SETTINGS, *PTASKBAR_SETTINGS; + +extern TASKBAR_SETTINGS TaskBarSettings; + +VOID +LoadTaskBarSettings(VOID); + +VOID +SaveTaskBarSettings(VOID); BOOL SaveSettingDword(IN LPCWSTR pszKeyName, Modified: trunk/reactos/base/shell/explorer/settings.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/settin…
============================================================================== --- trunk/reactos/base/shell/explorer/settings.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/settings.cpp [iso-8859-1] Fri Apr 14 18:08:34 2017 @@ -20,16 +20,23 @@ #include "precomp.h" -ADVANCED_SETTINGS AdvancedSettings; +TASKBAR_SETTINGS TaskBarSettings; const WCHAR szAdvancedSettingsKey[] = L"Software\\ReactOS\\Features\\Explorer"; VOID -LoadAdvancedSettings(VOID) +LoadTaskBarSettings(VOID) { HKEY hKey; /* Set defaults */ - AdvancedSettings.bShowSeconds = FALSE; + TaskBarSettings.bLock = TRUE; + TaskBarSettings.bAutoHide = FALSE; + TaskBarSettings.bAlwaysOnTop = FALSE; + TaskBarSettings.bGroupButtons = TRUE; + TaskBarSettings.bShowQuickLaunch = TRUE; + TaskBarSettings.bShowClock = TRUE; + TaskBarSettings.bShowSeconds = FALSE; + TaskBarSettings.bHideInactiveIcons = TRUE; /* Check registry */ if (RegOpenKeyW(HKEY_CURRENT_USER, szAdvancedSettingsKey, &hKey) == ERROR_SUCCESS) @@ -38,10 +45,16 @@ dwValueLength = sizeof(dwValue); if (RegQueryValueExW(hKey, L"ShowSeconds", NULL, &dwType, (PBYTE)&dwValue, &dwValueLength) == ERROR_SUCCESS && dwType == REG_DWORD) - AdvancedSettings.bShowSeconds = dwValue != 0; + TaskBarSettings.bShowSeconds = dwValue != 0; RegCloseKey(hKey); } +} + +VOID +SaveTaskBarSettings(VOID) +{ + SaveSettingDword(szAdvancedSettingsKey, TEXT("ShowSeconds"), TaskBarSettings.bShowSeconds); } BOOL Modified: trunk/reactos/base/shell/explorer/trayntfy.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/traynt…
============================================================================== --- trunk/reactos/base/shell/explorer/trayntfy.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/trayntfy.cpp [iso-8859-1] Fri Apr 14 18:08:34 2017 @@ -867,7 +867,7 @@ if (ClockWndFormats[i].IsTime) { iRet = GetTimeFormat(LOCALE_USER_DEFAULT, - AdvancedSettings.bShowSeconds ? ClockWndFormats[i].dwFormatFlags : TIME_NOSECONDS, + TaskBarSettings.bShowSeconds ? ClockWndFormats[i].dwFormatFlags : TIME_NOSECONDS, &LocalTime, ClockWndFormats[i].lpFormat, szLines[i], @@ -939,7 +939,7 @@ /* Calculate the due time */ GetLocalTime(&LocalTime); uiDueTime = 1000 - (UINT) LocalTime.wMilliseconds; - if (AdvancedSettings.bShowSeconds) + if (TaskBarSettings.bShowSeconds) uiDueTime += (UINT) LocalTime.wSecond * 100; else uiDueTime += (59 - (UINT) LocalTime.wSecond) * 1000; @@ -997,7 +997,7 @@ uiDueTime = CalculateDueTime(); - if (AdvancedSettings.bShowSeconds) + if (TaskBarSettings.bShowSeconds) { uiWait1 = 1000 - 200; uiWait2 = 1000; Modified: trunk/reactos/base/shell/explorer/trayprop.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/traypr…
============================================================================== --- trunk/reactos/base/shell/explorer/trayprop.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/trayprop.cpp [iso-8859-1] Fri Apr 14 18:08:34 2017 @@ -240,8 +240,14 @@ pPropInfo->hTaskbarWnd = hwnd; - // FIXME: check buttons - CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, AdvancedSettings.bShowSeconds ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bLock ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bAutoHide ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bAlwaysOnTop ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bGroupButtons ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bShowQuickLaunch ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bShowClock ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bShowSeconds ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, TaskBarSettings.bHideInactiveIcons ? BST_CHECKED : BST_UNCHECKED); UpdateBitmaps(pPropInfo); } @@ -313,8 +319,8 @@ break; case PSN_APPLY: - AdvancedSettings.bShowSeconds = IsDlgButtonChecked(hwndDlg, IDC_TASKBARPROP_SECONDS); - SaveSettingDword(szAdvancedSettingsKey, TEXT("ShowSeconds"), AdvancedSettings.bShowSeconds); + TaskBarSettings.bShowSeconds = IsDlgButtonChecked(hwndDlg, IDC_TASKBARPROP_SECONDS); + SaveTaskBarSettings(); break; }
7 years, 8 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
17
18
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Results per page:
10
25
50
100
200