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
July 2019
----- 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
22 participants
146 discussions
Start a n
N
ew thread
[reactos] 01/01: [DSOUND_NEW] Completely fix gcc compilation (addendum to 25e98eb). (#1740) CORE-16128
by Oleg Dubinskiy
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7f59361911421ebe08cc9…
commit 7f59361911421ebe08cc91d7a0de0289b0b3718f Author: Oleg Dubinskiy <oleg.dubinskij2013(a)yandex.ua> AuthorDate: Fri Jul 19 16:32:07 2019 +0300 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Jul 21 17:02:34 2019 +0200 [DSOUND_NEW] Completely fix gcc compilation (addendum to 25e98eb). (#1740) CORE-16128 --- dll/directx/dsound_new/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/directx/dsound_new/CMakeLists.txt b/dll/directx/dsound_new/CMakeLists.txt index 6e1fc6c89d6..a9445d14cac 100644 --- a/dll/directx/dsound_new/CMakeLists.txt +++ b/dll/directx/dsound_new/CMakeLists.txt @@ -25,6 +25,6 @@ add_library(dsound MODULE set_module_type(dsound win32dll) target_link_libraries(dsound dxguid uuid) -add_importlibs(dsound winmm advapi32 msvcrt kernel32 ntdll) +add_importlibs(dsound winmm ole32 advapi32 setupapi ksuser user32 msvcrt kernel32 ntdll) add_pch(dsound precomp.h SOURCE) add_cd_file(TARGET dsound DESTINATION reactos/system32 FOR all)
5 years, 5 months
1
0
0
0
[reactos] 01/01: [OSK] Use new coordinates on keyboard layout changing (#1745)
by Bișoc George
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4c4e3d60483e5b54d6e61…
commit 4c4e3d60483e5b54d6e61a2489606b496ee76116 Author: Bișoc George <fraizeraust99(a)gmail.com> AuthorDate: Sun Jul 21 16:52:25 2019 +0200 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Jul 21 16:52:25 2019 +0200 [OSK] Use new coordinates on keyboard layout changing (#1745) CORE-16214 --- base/applications/osk/main.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/base/applications/osk/main.c b/base/applications/osk/main.c index 4bb7f5010cb..0a3a001fa91 100644 --- a/base/applications/osk/main.c +++ b/base/applications/osk/main.c @@ -22,6 +22,7 @@ int OSK_DlgClose(void); int OSK_DlgTimer(void); BOOL OSK_DlgCommand(WPARAM wCommand, HWND hWndControl); BOOL OSK_ReleaseKey(WORD ScanCode); +VOID OSK_RestoreDlgPlacement(HWND hDlg); INT_PTR APIENTRY OSK_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); LRESULT APIENTRY OSK_ThemeHandler(HWND hDlg, NMCUSTOMDRAW *pNmDraw); @@ -255,6 +256,18 @@ int OSK_DlgInitDialog(HWND hDlg) return TRUE; } +/*********************************************************************** + * + * OSK_RestoreDlgPlacement + * + * Restores the dialog placement + */ +VOID OSK_RestoreDlgPlacement(HWND hDlg) +{ + LoadDataFromRegistry(); + SetWindowPos(hDlg, (Globals.bAlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST), Globals.PosX, Globals.PosY, 0, 0, SWP_NOSIZE); +} + /*********************************************************************** * * OSK_DlgClose @@ -593,6 +606,13 @@ INT_PTR APIENTRY OSK_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) CheckMenuItem(GetMenu(hDlg), IDM_ENHANCED_KB, MF_BYCOMMAND | MF_CHECKED); CheckMenuItem(GetMenu(hDlg), IDM_STANDARD_KB, MF_BYCOMMAND | MF_UNCHECKED); + /* + Before creating the dialog box restore the coordinates. The user can + move the dialog around before choosing a different dialog layout therefore + we must create the dialog with the new coordinates. + */ + OSK_RestoreDlgPlacement(hDlg); + /* Finally, display the dialog modal box with the enhanced keyboard dialog */ DialogBoxW(Globals.hInstance, MAKEINTRESOURCEW(MAIN_DIALOG_ENHANCED_KB), @@ -619,6 +639,13 @@ INT_PTR APIENTRY OSK_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) CheckMenuItem(GetMenu(hDlg), IDM_ENHANCED_KB, MF_BYCOMMAND | MF_UNCHECKED); CheckMenuItem(GetMenu(hDlg), IDM_STANDARD_KB, MF_BYCOMMAND | MF_CHECKED); + /* + Before creating the dialog box restore the coordinates. The user can + move the dialog around before choosing a different dialog layout therefore + we must create the dialog with the new coordinates. + */ + OSK_RestoreDlgPlacement(hDlg); + /* Finally, display the dialog modal box with the standard keyboard dialog */ DialogBoxW(Globals.hInstance, MAKEINTRESOURCEW(MAIN_DIALOG_STANDARD_KB),
5 years, 5 months
1
0
0
0
[reactos] 01/01: [WIN32SS][GDI] Assume pso->sizlBitmap.cy positiveness (#1743)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=31d616ff732c754c5de41…
commit 31d616ff732c754c5de41eb8aad8c9ba4c5a189e Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Jul 21 21:39:05 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sun Jul 21 21:39:05 2019 +0900 [WIN32SS][GDI] Assume pso->sizlBitmap.cy positiveness (#1743) We assume pso->sizlBitmap.cy is positive. CORE-15995 Because pso->sizlBitmap.cy is certificated as a positive value after initialization in SURFACE_AllocSurface, so we can safely omit abs and labs (absolute) function calls for it. --- win32ss/gdi/dib/stretchblt.c | 4 ++-- win32ss/gdi/ntgdi/bitmaps.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/win32ss/gdi/dib/stretchblt.c b/win32ss/gdi/dib/stretchblt.c index cbcdad2f88c..c768cf8e34c 100644 --- a/win32ss/gdi/dib/stretchblt.c +++ b/win32ss/gdi/dib/stretchblt.c @@ -58,7 +58,7 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma if (UsesSource) { - SourceCy = abs(SourceSurf->sizlBitmap.cy); + SourceCy = SourceSurf->sizlBitmap.cy; fnSource_GetPixel = DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat].DIB_GetPixel; DPRINT("Source BPP: %u, srcRect: (%d,%d)-(%d,%d)\n", BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom); @@ -67,7 +67,7 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma if (MaskSurf) { fnMask_GetPixel = DibFunctionsForBitmapFormat[MaskSurf->iBitmapFormat].DIB_GetPixel; - MaskCy = abs(MaskSurf->sizlBitmap.cy); + MaskCy = MaskSurf->sizlBitmap.cy; } DstHeight = DestRect->bottom - DestRect->top; diff --git a/win32ss/gdi/ntgdi/bitmaps.c b/win32ss/gdi/ntgdi/bitmaps.c index 59fb5dd9d15..dbde5fd42c2 100644 --- a/win32ss/gdi/ntgdi/bitmaps.c +++ b/win32ss/gdi/ntgdi/bitmaps.c @@ -59,7 +59,7 @@ UnsafeSetBitmapBits( NT_ASSERT(psurf->SurfObj.iBitmapFormat <= BMF_32BPP); nWidth = psurf->SurfObj.sizlBitmap.cx; - nHeight = labs(psurf->SurfObj.sizlBitmap.cy); + nHeight = psurf->SurfObj.sizlBitmap.cy; cBitsPixel = BitsPerFormat(psurf->SurfObj.iBitmapFormat); pjDst = psurf->SurfObj.pvScan0; @@ -509,7 +509,7 @@ UnsafeGetBitmapBits( ULONG Y, iSrc, iDst, cbSrc, cbDst, nWidth, nHeight, cBitsPixel; nWidth = psurf->SurfObj.sizlBitmap.cx; - nHeight = labs(psurf->SurfObj.sizlBitmap.cy); + nHeight = psurf->SurfObj.sizlBitmap.cy; cBitsPixel = BitsPerFormat(psurf->SurfObj.iBitmapFormat); /* Get pointers */ @@ -575,7 +575,7 @@ NtGdiGetBitmapBits( /* Calculate the size of the bitmap in bytes */ cjSize = WIDTH_BYTES_ALIGN16(psurf->SurfObj.sizlBitmap.cx, BitsPerFormat(psurf->SurfObj.iBitmapFormat)) * - abs(psurf->SurfObj.sizlBitmap.cy); + psurf->SurfObj.sizlBitmap.cy; /* If the bits vector is null, the function should return the read size */ if (pUnsafeBits == NULL)
5 years, 5 months
1
0
0
0
[reactos] 01/01: [ADVAPI32] Avoid excessive allocation in CheckTokenMembership. CORE-16094
by Michael Maltsev
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a303932803d5939c4b682…
commit a303932803d5939c4b6820f693fef310e48ee18b Author: Michael Maltsev <4129781+m417z(a)users.noreply.github.com> AuthorDate: Mon Jun 3 12:35:58 2019 +0300 Commit: Thomas Faber <thomas.faber(a)reactos.org> CommitDate: Sun Jul 21 11:39:30 2019 +0200 [ADVAPI32] Avoid excessive allocation in CheckTokenMembership. CORE-16094 --- dll/win32/advapi32/token/token.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/win32/advapi32/token/token.c b/dll/win32/advapi32/token/token.c index 0c3cacd7725..32ef4064c6b 100644 --- a/dll/win32/advapi32/token/token.c +++ b/dll/win32/advapi32/token/token.c @@ -100,7 +100,7 @@ CheckTokenMembership(IN HANDLE ExistingTokenHandle, 0, sizeof(SECURITY_DESCRIPTOR) + sizeof(ACL) + SidLen + - sizeof(ACCESS_ALLOWED_ACE)); + FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart)); if (SecurityDescriptor == NULL) { Status = STATUS_INSUFFICIENT_RESOURCES; @@ -134,7 +134,7 @@ CheckTokenMembership(IN HANDLE ExistingTokenHandle, /* create the DACL */ Dacl = (PACL)(SecurityDescriptor + 1); Status = RtlCreateAcl(Dacl, - sizeof(ACL) + SidLen + sizeof(ACCESS_ALLOWED_ACE), + sizeof(ACL) + SidLen + FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart), ACL_REVISION); if (!NT_SUCCESS(Status)) {
5 years, 5 months
1
0
0
0
[reactos] 01/01: [MEDIA][FONTS] Shrink Marlett.ttf file size
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=17bc3d69f91d9442bc900…
commit 17bc3d69f91d9442bc900f7bfcabf8f3e0481839 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Jul 21 15:17:02 2019 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Sun Jul 21 15:17:02 2019 +0900 [MEDIA][FONTS] Shrink Marlett.ttf file size --- media/fonts/Marlett.ttf | Bin 4716 -> 4160 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/media/fonts/Marlett.ttf b/media/fonts/Marlett.ttf index ea6fdac4038..26b7980bb30 100644 Binary files a/media/fonts/Marlett.ttf and b/media/fonts/Marlett.ttf differ
5 years, 5 months
1
0
0
0
[reactos] 01/01: [FONTS][NTGDI] Change Marlett.ttf charset and delete charset hacks
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=023794c7c18e66cee8ebd…
commit 023794c7c18e66cee8ebd2daf0dee3d213a66c10 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Jul 21 12:59:06 2019 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Sun Jul 21 12:59:06 2019 +0900 [FONTS][NTGDI] Change Marlett.ttf charset and delete charset hacks --- media/fonts/Marlett.ttf | Bin 3572 -> 4716 bytes win32ss/gdi/ntgdi/freetype.c | 27 --------------------------- 2 files changed, 27 deletions(-) diff --git a/media/fonts/Marlett.ttf b/media/fonts/Marlett.ttf index d246ccfc42c..ea6fdac4038 100644 Binary files a/media/fonts/Marlett.ttf and b/media/fonts/Marlett.ttf differ diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index 5d14f4ca799..4e4d4f6f8fd 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -50,10 +50,6 @@ static const FT_Matrix identityMat = {(1 << 16), 0, 0, (1 << 16)}; FT_Library g_FreeTypeLibrary; -/* special font names */ -static const UNICODE_STRING g_MarlettW = RTL_CONSTANT_STRING(L"Marlett"); -#define MARLETT_HACK_CHARSET - /* registry */ static UNICODE_STRING g_FontRegPath = RTL_CONSTANT_STRING(L"\\REGISTRY\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"); @@ -1307,14 +1303,6 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont) if (FT_IS_SFNT(Face)) { FontGDI->CharSet = IntGetCharSet(iCharSet, os2_ulCodePageRange1); - -#ifdef MARLETT_HACK_CHARSET - /* FIXME: CharSet is invalid on our Marlett */ - if (RtlEqualUnicodeString(&Entry->FaceName, &g_MarlettW, TRUE)) - { - FontGDI->CharSet = SYMBOL_CHARSET; - } -#endif } else { @@ -4549,21 +4537,6 @@ GetFontPenalty(const LOGFONTW * LogFont, Byte = LogFont->lfCharSet; -#ifdef MARLETT_HACK_CHARSET - if (Byte == DEFAULT_CHARSET) - { - if (_wcsicmp(LogFont->lfFaceName, L"Marlett") == 0) - { - if (Byte == ANSI_CHARSET) - { - DPRINT("Warning: FIXME: It's Marlett but ANSI_CHARSET.\n"); - } - /* We assume SYMBOL_CHARSET for "Marlett" font */ - Byte = SYMBOL_CHARSET; - } - } -#endif - if (Byte != TM->tmCharSet) { if (Byte != DEFAULT_CHARSET && Byte != ANSI_CHARSET)
5 years, 5 months
1
0
0
0
[reactos] 01/01: [MSCONFIG][ROSAPPS] Remove explicit MINGW_HAS_SECURE_API since it is already enabled globally. CORE-16224
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5666ea2061b3efacd4c44…
commit 5666ea2061b3efacd4c44a3a53836567a2441dcb Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Jul 21 01:06:54 2019 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Jul 21 01:06:54 2019 +0200 [MSCONFIG][ROSAPPS] Remove explicit MINGW_HAS_SECURE_API since it is already enabled globally. CORE-16224 --- base/applications/msconfig_new/precomp.h | 5 ----- modules/rosapps/applications/devutils/createspec/createspec.c | 1 - 2 files changed, 6 deletions(-) diff --git a/base/applications/msconfig_new/precomp.h b/base/applications/msconfig_new/precomp.h index afa23d0a941..5fe9ad206c7 100644 --- a/base/applications/msconfig_new/precomp.h +++ b/base/applications/msconfig_new/precomp.h @@ -1,11 +1,6 @@ #ifndef _MSCONFIG_PCH_ #define _MSCONFIG_PCH_ -// NOTE: It is completely idiotic to need those defines defined -// for having the *_s string functions. In the MS CRT they are -// directly available without further tricks. -#define MINGW_HAS_SECURE_API 1 - #include <assert.h> #include <stdarg.h> diff --git a/modules/rosapps/applications/devutils/createspec/createspec.c b/modules/rosapps/applications/devutils/createspec/createspec.c index 0c0600d387d..9f5de70a4a7 100644 --- a/modules/rosapps/applications/devutils/createspec/createspec.c +++ b/modules/rosapps/applications/devutils/createspec/createspec.c @@ -8,7 +8,6 @@ - Resolve forwarders */ -#define MINGW_HAS_SECURE_API #include <stdio.h> #include <stdlib.h> #include <windows.h>
5 years, 5 months
1
0
0
0
[reactos] 01/01: [WIN32K:NTGDI] Improve allocated resources cleanup in failure paths of IntGdiLoadFontsFromMemory().
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3de67cec245cc9468c4fe…
commit 3de67cec245cc9468c4fe9fb061f79fa98f5ec23 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Jul 21 00:47:58 2019 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Jul 21 01:01:41 2019 +0200 [WIN32K:NTGDI] Improve allocated resources cleanup in failure paths of IntGdiLoadFontsFromMemory(). - Use an auxiliary list where we add the new enumerated faces, for easy roll-back in case a failure happens during font loading. Only at the very end when font loading has been successfully done, the auxiliary list is appended to the corresponding global or per-proceess font list. - Perform actual cleanup in case of failures. - Introduce CleanupFontEntryEx() helper to simplify cleanup in IntGdiLoadFontsFromMemory() in failure paths; implement CleanupFontEntry() around it. Additions: - Perform string buffer NULL check in IntGdiAddFontResource(). - Reorder memory unmapping and section object dereferencing in IntGdiAddFontResource(). - Move DuplicateUnicodeString() upwards. - Mark explicitly the Marlett font handling hacks. --- win32ss/gdi/ntgdi/freetype.c | 442 +++++++++++++++++++++++++++---------------- 1 file changed, 282 insertions(+), 160 deletions(-) diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index 29f87d14229..5d14f4ca799 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -5,7 +5,7 @@ * PURPOSE: FreeType font engine interface * PROGRAMMERS: Copyright 2001 Huw D M Davies for CodeWeavers. * Copyright 2006 Dmitry Timoshkov for CodeWeavers. - * Copyright 2016-2018 Katayama Hirofumi MZ. + * Copyright 2016-2019 Katayama Hirofumi MZ. */ /** Includes ******************************************************************/ @@ -52,6 +52,7 @@ FT_Library g_FreeTypeLibrary; /* special font names */ static const UNICODE_STRING g_MarlettW = RTL_CONSTANT_STRING(L"Marlett"); +#define MARLETT_HACK_CHARSET /* registry */ static UNICODE_STRING g_FontRegPath = @@ -337,6 +338,33 @@ SharedFace_Release(PSHARED_FACE Ptr) } +static VOID FASTCALL +CleanupFontEntryEx(PFONT_ENTRY FontEntry, PFONTGDI FontGDI) +{ + // PFONTGDI FontGDI = FontEntry->Font; + PSHARED_FACE SharedFace = FontGDI->SharedFace; + + if (FontGDI->Filename) + ExFreePoolWithTag(FontGDI->Filename, GDITAG_PFF); + + if (FontEntry->StyleName.Buffer) + RtlFreeUnicodeString(&FontEntry->StyleName); + + if (FontEntry->FaceName.Buffer) + RtlFreeUnicodeString(&FontEntry->FaceName); + + EngFreeMem(FontGDI); + SharedFace_Release(SharedFace); + ExFreePoolWithTag(FontEntry, TAG_FONT); +} + +static __inline VOID FASTCALL +CleanupFontEntry(PFONT_ENTRY FontEntry) +{ + CleanupFontEntryEx(FontEntry, FontEntry->Font); +} + + static __inline void FTVectorToPOINTFX(FT_Vector *vec, POINTFX *pt) { pt->x.value = vec->x >> 6; @@ -832,9 +860,9 @@ SubstituteFontByList(PLIST_ENTRY pHead, } static VOID -IntUnicodeStringToBuffer(LPWSTR pszBuffer, USHORT cbBuffer, const UNICODE_STRING *pString) +IntUnicodeStringToBuffer(LPWSTR pszBuffer, SIZE_T cbBuffer, const UNICODE_STRING *pString) { - USHORT cbLength = pString->Length; + SIZE_T cbLength = pString->Length; if (cbBuffer < sizeof(UNICODE_NULL)) return; @@ -846,6 +874,29 @@ IntUnicodeStringToBuffer(LPWSTR pszBuffer, USHORT cbBuffer, const UNICODE_STRING pszBuffer[cbLength / sizeof(WCHAR)] = UNICODE_NULL; } +static NTSTATUS +DuplicateUnicodeString(PUNICODE_STRING Source, PUNICODE_STRING Destination) +{ + NTSTATUS Status = STATUS_NO_MEMORY; + UNICODE_STRING Tmp; + + Tmp.Buffer = ExAllocatePoolWithTag(PagedPool, Source->MaximumLength, TAG_USTR); + if (Tmp.Buffer) + { + Tmp.MaximumLength = Source->MaximumLength; + Tmp.Length = 0; + RtlCopyUnicodeString(&Tmp, Source); + + Destination->MaximumLength = Tmp.MaximumLength; + Destination->Length = Tmp.Length; + Destination->Buffer = Tmp.Buffer; + + Status = STATUS_SUCCESS; + } + + return Status; +} + static BOOL SubstituteFontRecurse(LOGFONTW* pLogFont) { @@ -1083,9 +1134,10 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont) { FT_Error Error; PFONT_ENTRY Entry; - FONT_ENTRY_MEM* PrivateEntry; - FONTGDI * FontGDI; + PFONT_ENTRY_MEM PrivateEntry; + PFONTGDI FontGDI; FT_Face Face; + NTSTATUS Status; ANSI_STRING AnsiString; FT_WinFNT_HeaderRec WinFNT; PUNICODE_STRING pFileName = pLoadFont->pFileName; @@ -1096,12 +1148,14 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont) PSHARED_FACE SharedFace; INT iCharSet, CharSetCount; FT_Long iFace, FaceCount; + LIST_ENTRY LoadedFontList; USHORT NameLength; - WCHAR szSize[32]; + SIZE_T Length; + PWCHAR pszBuffer; UNICODE_STRING NewString; - USHORT Length; + WCHAR szSize[32]; - /* get num_faces */ + /* Retrieve the number of faces */ IntLockFreeType(); Error = FT_New_Memory_Face(g_FreeTypeLibrary, pLoadFont->Memory->Buffer, @@ -1121,6 +1175,17 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont) return 0; /* failure */ } + /* + * Initialize the temporary font list that needs to be appended to the + * global or per-process font table, in case font enumeration successes. + * If an error happens while loading and enumerating the fonts, this list + * is used to cleanup the allocated resources. + */ + InitializeListHead(&LoadedFontList); + + /* + * Enumerate each typeface in the font. + */ for (iFace = 0; iFace < FaceCount; ++iFace) { Face = NULL; @@ -1141,7 +1206,7 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont) if (Error || !SharedFace) { DPRINT1("Error reading font (FT_Error: %d)\n", Error); - return 0; + goto Finish; /* failure */ } /* os2_ulCodePageRange1 and CharSetCount and IsTrueType */ @@ -1165,8 +1230,16 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont) pLoadFont->IsTrueType = FALSE; } + /* + * Enumerate all supported character sets for the selected typeface. + */ for (iCharSet = 0; iCharSet < CharSetCount; ++iCharSet) { + /* + * Add a reference to SharedFace only when iCharSet is > 0, + * since the first reference has been already done by the + * SharedFace_Create() call above. + */ if (iCharSet > 0) { IntLockFreeType(); @@ -1174,28 +1247,28 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont) IntUnLockFreeType(); } - /* allocate a FONT_ENTRY */ + /* Allocate a FONT_ENTRY */ Entry = ExAllocatePoolWithTag(PagedPool, sizeof(FONT_ENTRY), TAG_FONT); if (!Entry) { + DPRINT1("Failed to allocate FONT_ENTRY\n"); SharedFace_Release(SharedFace); EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); - DPRINT1("ERROR_NOT_ENOUGH_MEMORY\n"); - return 0; /* failure */ + goto Finish; /* failure */ } - /* allocate a FONTGDI */ + /* Allocate a FONTGDI */ FontGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(FONTGDI), GDITAG_RFONT); if (!FontGDI) { + DPRINT1("Failed to allocate FontGDI\n"); SharedFace_Release(SharedFace); ExFreePoolWithTag(Entry, TAG_FONT); EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); - DPRINT1("ERROR_NOT_ENOUGH_MEMORY\n"); - return 0; /* failure */ + goto Finish; /* failure */ } - /* set face */ + /* Set face */ FontGDI->SharedFace = SharedFace; FontGDI->CharSet = ANSI_CHARSET; FontGDI->OriginalItalic = ItalicFromStyle(Face->style_name); @@ -1205,18 +1278,29 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont) /* Entry->FaceName */ RtlInitAnsiString(&AnsiString, Face->family_name); - RtlAnsiStringToUnicodeString(&Entry->FaceName, &AnsiString, TRUE); + Status = RtlAnsiStringToUnicodeString(&Entry->FaceName, &AnsiString, TRUE); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to allocate Entry->FaceName\n"); + CleanupFontEntryEx(Entry, FontGDI); + EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); + goto Finish; /* failure */ + } /* Entry->StyleName */ + RtlInitUnicodeString(&Entry->StyleName, NULL); if (Face->style_name && Face->style_name[0] && strcmp(Face->style_name, "Regular") != 0) { RtlInitAnsiString(&AnsiString, Face->style_name); - RtlAnsiStringToUnicodeString(&Entry->StyleName, &AnsiString, TRUE); - } - else - { - RtlInitUnicodeString(&Entry->StyleName, NULL); + Status = RtlAnsiStringToUnicodeString(&Entry->StyleName, &AnsiString, TRUE); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to allocate Entry->StyleName\n"); + CleanupFontEntryEx(Entry, FontGDI); + EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); + goto Finish; /* failure */ + } } /* FontGDI->CharSet */ @@ -1224,11 +1308,13 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont) { FontGDI->CharSet = IntGetCharSet(iCharSet, os2_ulCodePageRange1); +#ifdef MARLETT_HACK_CHARSET /* FIXME: CharSet is invalid on our Marlett */ if (RtlEqualUnicodeString(&Entry->FaceName, &g_MarlettW, TRUE)) { FontGDI->CharSet = SYMBOL_CHARSET; } +#endif } else { @@ -1241,40 +1327,37 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont) IntUnLockFreeType(); } - /* set file name */ + /* Set the file name */ if (pFileName) { - FontGDI->Filename = ExAllocatePoolWithTag(PagedPool, - pFileName->Length + sizeof(UNICODE_NULL), - GDITAG_PFF); + // TODO: Since this Filename is common to all the faces+charsets + // inside the given font, it may be worth to somehow cache it + // only once and share it amongst all these faces+charsets. + + Length = pFileName->Length + sizeof(UNICODE_NULL); + FontGDI->Filename = ExAllocatePoolWithTag(PagedPool, Length, GDITAG_PFF); if (FontGDI->Filename == NULL) { - EngFreeMem(FontGDI); - SharedFace_Release(SharedFace); - ExFreePoolWithTag(Entry, TAG_FONT); + DPRINT1("Failed to allocate FontGDI->Filename\n"); + CleanupFontEntryEx(Entry, FontGDI); EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); - DPRINT1("ERROR_NOT_ENOUGH_MEMORY\n"); - return 0; /* failure */ + goto Finish; /* failure */ } - - RtlCopyMemory(FontGDI->Filename, pFileName->Buffer, pFileName->Length); - FontGDI->Filename[pFileName->Length / sizeof(WCHAR)] = UNICODE_NULL; + IntUnicodeStringToBuffer(FontGDI->Filename, Length, pFileName); } else { + /* This is a memory font, initialize a suitable entry */ + FontGDI->Filename = NULL; PrivateEntry = ExAllocatePoolWithTag(PagedPool, sizeof(FONT_ENTRY_MEM), TAG_FONT); if (!PrivateEntry) { - if (FontGDI->Filename) - ExFreePoolWithTag(FontGDI->Filename, GDITAG_PFF); - EngFreeMem(FontGDI); - SharedFace_Release(SharedFace); - ExFreePoolWithTag(Entry, TAG_FONT); + DPRINT1("Failed to allocate PrivateEntry\n"); + CleanupFontEntryEx(Entry, FontGDI); EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); - DPRINT1("ERROR_NOT_ENOUGH_MEMORY\n"); - return 0; + goto Finish; /* failure */ } PrivateEntry->Entry = Entry; @@ -1292,22 +1375,7 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont) /* Add this font resource to the font table */ Entry->Font = FontGDI; Entry->NotEnum = (Characteristics & FR_NOT_ENUM); - - if (Characteristics & FR_PRIVATE) - { - /* private font */ - PPROCESSINFO Win32Process = PsGetCurrentProcessWin32Process(); - IntLockProcessPrivateFonts(Win32Process); - InsertTailList(&Win32Process->PrivateFontListHead, &Entry->ListEntry); - IntUnLockProcessPrivateFonts(Win32Process); - } - else - { - /* global font */ - IntLockGlobalFonts(); - InsertTailList(&g_FontListHead, &Entry->ListEntry); - IntUnLockGlobalFonts(); - } + InsertTailList(&LoadedFontList, &Entry->ListEntry); DPRINT("Font loaded: %s (%s)\n", Face->family_name ? Face->family_name : "<NULL>", @@ -1317,62 +1385,77 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont) } IntLockFreeType(); - IntRequestFontSize(NULL, FontGDI, 0, 0); + /* Error = */ IntRequestFontSize(NULL, FontGDI, 0, 0); IntUnLockFreeType(); + /* + * Initialize and build the registry font value entry, + * only in the case we load fonts from a file and not from memory. + */ + if (!pFileName) + continue; NameLength = Entry->FaceName.Length; - if (pLoadFont->RegValueName.Length == 0) + if (pValueName->Length == 0) { if (FT_IS_SFNT(Face)) { - RtlCreateUnicodeString(pValueName, Entry->FaceName.Buffer); + Status = DuplicateUnicodeString(&Entry->FaceName, pValueName); + // TODO: Check return value } else { szSize[0] = L' '; - _itow(PX2PT(FontGDI->EmHeight), &szSize[1], 10); - - Length = NameLength + wcslen(szSize) * sizeof(WCHAR); - pValueName->Length = 0; - pValueName->MaximumLength = Length + sizeof(WCHAR); - pValueName->Buffer = ExAllocatePoolWithTag(PagedPool, - pValueName->MaximumLength, - TAG_USTR); - pValueName->Buffer[0] = UNICODE_NULL; - RtlAppendUnicodeStringToString(pValueName, &Entry->FaceName); - RtlAppendUnicodeToString(pValueName, szSize); + _itow(PX2PT(FontGDI->EmHeight), szSize+1, 10); + + Length = NameLength + (wcslen(szSize) + 1) * sizeof(WCHAR); + pszBuffer = ExAllocatePoolWithTag(PagedPool, Length, TAG_USTR); + if (pszBuffer) + { + RtlInitEmptyUnicodeString(pValueName, pszBuffer, (USHORT)Length); + RtlCopyUnicodeString(pValueName, &Entry->FaceName); + RtlAppendUnicodeToString(pValueName, szSize); + } + else + { + // FIXME! + } } } else { if (FT_IS_SFNT(Face)) { - Length = pValueName->Length + 3 * sizeof(WCHAR) + NameLength; - NewString.Length = 0; - NewString.MaximumLength = Length + sizeof(WCHAR); - NewString.Buffer = ExAllocatePoolWithTag(PagedPool, - NewString.MaximumLength, - TAG_USTR); - NewString.Buffer[0] = UNICODE_NULL; - RtlAppendUnicodeStringToString(&NewString, pValueName); - RtlAppendUnicodeToString(&NewString, L" & "); - RtlAppendUnicodeStringToString(&NewString, &Entry->FaceName); + Length = pValueName->Length + 3 * sizeof(WCHAR) + NameLength + sizeof(UNICODE_NULL); + pszBuffer = ExAllocatePoolWithTag(PagedPool, Length, TAG_USTR); + if (pszBuffer) + { + RtlInitEmptyUnicodeString(&NewString, pszBuffer, (USHORT)Length); + RtlCopyUnicodeString(&NewString, pValueName); + RtlAppendUnicodeToString(&NewString, L" & "); + RtlAppendUnicodeStringToString(&NewString, &Entry->FaceName); + } + else + { + // FIXME! + } } else { szSize[0] = L','; - szSize[1] = L' '; - _itow(PX2PT(FontGDI->EmHeight), &szSize[2], 10); - - Length = pValueName->Length + wcslen(szSize) * sizeof(WCHAR); - NewString.Length = 0; - NewString.MaximumLength = Length + sizeof(WCHAR); - NewString.Buffer = ExAllocatePoolWithTag(PagedPool, - NewString.MaximumLength, - TAG_USTR); - NewString.Buffer[0] = UNICODE_NULL; - RtlAppendUnicodeStringToString(&NewString, pValueName); - RtlAppendUnicodeToString(&NewString, szSize); + _itow(PX2PT(FontGDI->EmHeight), szSize+1, 10); + + Length = pValueName->Length + (wcslen(szSize) + 1) * sizeof(WCHAR); + pszBuffer = ExAllocatePoolWithTag(PagedPool, Length, TAG_USTR); + if (pszBuffer) + { + RtlInitEmptyUnicodeString(&NewString, pszBuffer, (USHORT)Length); + RtlCopyUnicodeString(&NewString, pValueName); + RtlAppendUnicodeToString(&NewString, szSize); + } + else + { + // FIXME! + } } RtlFreeUnicodeString(pValueName); @@ -1380,7 +1463,77 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont) } } - return FaceCount; /* number of loaded faces */ +Finish: + if (iFace == FaceCount) + { + /* + * We succeeded, append the created font entries into the correct font table. + */ + PLIST_ENTRY ListToAppend; + + /* No typefaces were present */ + if (FaceCount == 0) + { + ASSERT(IsListEmpty(&LoadedFontList)); + return 0; + } + + ASSERT(!IsListEmpty(&LoadedFontList)); + + /* + * Remove the temporary font list' head and reinitialize it. + * This effectively empties the list and at the same time transforms + * 'ListToAppend' into a headless list, ready to be appended to the + * suitable font table. + */ + ListToAppend = LoadedFontList.Flink; + RemoveEntryList(&LoadedFontList); + InitializeListHead(&LoadedFontList); + + if (Characteristics & FR_PRIVATE) + { + /* Private font */ + PPROCESSINFO Win32Process = PsGetCurrentProcessWin32Process(); + IntLockProcessPrivateFonts(Win32Process); + AppendTailList(&Win32Process->PrivateFontListHead, ListToAppend); + IntUnLockProcessPrivateFonts(Win32Process); + } + else + { + /* Global font */ + IntLockGlobalFonts(); + AppendTailList(&g_FontListHead, ListToAppend); + IntUnLockGlobalFonts(); + } + + return FaceCount; /* Number of loaded faces */ + } + else + { + /* We failed, cleanup the resources */ + PLIST_ENTRY ListEntry; + + if (pLoadFont->PrivateEntry) + { + while (!IsListEmpty(&pLoadFont->PrivateEntry->ListEntry)) + { + ListEntry = RemoveHeadList(&pLoadFont->PrivateEntry->ListEntry); + PrivateEntry = CONTAINING_RECORD(ListEntry, FONT_ENTRY_MEM, ListEntry); + ExFreePoolWithTag(PrivateEntry, TAG_FONT); + } + ExFreePoolWithTag(pLoadFont->PrivateEntry, TAG_FONT); + pLoadFont->PrivateEntry = NULL; + } + + while (!IsListEmpty(&LoadedFontList)) + { + ListEntry = RemoveHeadList(&LoadedFontList); + Entry = CONTAINING_RECORD(ListEntry, FONT_ENTRY, ListEntry); + CleanupFontEntry(Entry); + } + + return 0; /* No faces have been added */ + } } /* @@ -1400,7 +1553,7 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics) SIZE_T ViewSize = 0; LARGE_INTEGER SectionSize; OBJECT_ATTRIBUTES ObjectAttributes; - GDI_LOAD_FONT LoadFont; + GDI_LOAD_FONT LoadFont; INT FontCount; HANDLE KeyHandle; static const UNICODE_STRING TrueTypePostfix = RTL_CONSTANT_STRING(L" (TrueType)"); @@ -1448,36 +1601,40 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics) LoadFont.PrivateEntry = NULL; FontCount = IntGdiLoadFontsFromMemory(&LoadFont); - ObDereferenceObject(SectionObject); - /* Release our copy */ IntLockFreeType(); SharedMem_Release(LoadFont.Memory); IntUnLockFreeType(); + ObDereferenceObject(SectionObject); + + /* Save the loaded font name into the registry */ if (FontCount > 0) { if (LoadFont.IsTrueType) { - /* append " (TrueType)" */ + /* Append " (TrueType)" */ UNICODE_STRING NewString; - USHORT Length; - - Length = LoadFont.RegValueName.Length + TrueTypePostfix.Length; - NewString.Length = 0; - NewString.MaximumLength = Length + sizeof(WCHAR); - NewString.Buffer = ExAllocatePoolWithTag(PagedPool, - NewString.MaximumLength, - TAG_USTR); - NewString.Buffer[0] = UNICODE_NULL; + SIZE_T Length; + PWCHAR pszBuffer; - RtlAppendUnicodeStringToString(&NewString, &LoadFont.RegValueName); - RtlAppendUnicodeStringToString(&NewString, &TrueTypePostfix); - RtlFreeUnicodeString(&LoadFont.RegValueName); - LoadFont.RegValueName = NewString; + Length = LoadFont.RegValueName.Length + TrueTypePostfix.Length + sizeof(UNICODE_NULL); + pszBuffer = ExAllocatePoolWithTag(PagedPool, Length, TAG_USTR); + if (pszBuffer) + { + RtlInitEmptyUnicodeString(&NewString, pszBuffer, (USHORT)Length); + NewString.Buffer[0] = UNICODE_NULL; + RtlAppendUnicodeStringToString(&NewString, &LoadFont.RegValueName); + RtlAppendUnicodeStringToString(&NewString, &TrueTypePostfix); + RtlFreeUnicodeString(&LoadFont.RegValueName); + LoadFont.RegValueName = NewString; + } + else + { + // FIXME! + } } - /* registry */ InitializeObjectAttributes(&ObjectAttributes, &g_FontRegPath, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, NULL, NULL); @@ -1504,26 +1661,25 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics) HANDLE FASTCALL IntGdiAddFontMemResource(PVOID Buffer, DWORD dwSize, PDWORD pNumAdded) { + HANDLE Ret = NULL; GDI_LOAD_FONT LoadFont; - FONT_ENTRY_COLL_MEM* EntryCollection; + PFONT_ENTRY_COLL_MEM EntryCollection; INT FaceCount; - HANDLE Ret = 0; PVOID BufferCopy = ExAllocatePoolWithTag(PagedPool, dwSize, TAG_FONT); - if (!BufferCopy) { *pNumAdded = 0; return NULL; } - memcpy(BufferCopy, Buffer, dwSize); + RtlCopyMemory(BufferCopy, Buffer, dwSize); - LoadFont.pFileName = NULL; - LoadFont.Memory = SharedMem_Create(BufferCopy, dwSize, FALSE); - LoadFont.Characteristics = FR_PRIVATE | FR_NOT_ENUM; + LoadFont.pFileName = NULL; + LoadFont.Memory = SharedMem_Create(BufferCopy, dwSize, FALSE); + LoadFont.Characteristics = FR_PRIVATE | FR_NOT_ENUM; RtlInitUnicodeString(&LoadFont.RegValueName, NULL); - LoadFont.IsTrueType = FALSE; - LoadFont.PrivateEntry = NULL; + LoadFont.IsTrueType = FALSE; + LoadFont.PrivateEntry = NULL; FaceCount = IntGdiLoadFontsFromMemory(&LoadFont); RtlFreeUnicodeString(&LoadFont.RegValueName); @@ -1554,20 +1710,6 @@ IntGdiAddFontMemResource(PVOID Buffer, DWORD dwSize, PDWORD pNumAdded) // 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) { @@ -2352,29 +2494,6 @@ SwapEndian(LPVOID pvData, DWORD Size) } } -static NTSTATUS -DuplicateUnicodeString(PUNICODE_STRING Source, PUNICODE_STRING Destination) -{ - NTSTATUS Status = STATUS_NO_MEMORY; - UNICODE_STRING Tmp; - - Tmp.Buffer = ExAllocatePoolWithTag(PagedPool, Source->MaximumLength, TAG_USTR); - if (Tmp.Buffer) - { - Tmp.MaximumLength = Source->MaximumLength; - Tmp.Length = 0; - RtlCopyUnicodeString(&Tmp, Source); - - Destination->MaximumLength = Tmp.MaximumLength; - Destination->Length = Tmp.Length; - Destination->Buffer = Tmp.Buffer; - - Status = STATUS_SUCCESS; - } - - return Status; -} - static NTSTATUS IntGetFontLocalizedName(PUNICODE_STRING pNameW, PSHARED_FACE SharedFace, FT_UShort NameID, FT_UShort LangID) @@ -4429,6 +4548,8 @@ GetFontPenalty(const LOGFONTW * LogFont, /* FIXME: FaceNameSubst Penalty 500 */ Byte = LogFont->lfCharSet; + +#ifdef MARLETT_HACK_CHARSET if (Byte == DEFAULT_CHARSET) { if (_wcsicmp(LogFont->lfFaceName, L"Marlett") == 0) @@ -4441,6 +4562,7 @@ GetFontPenalty(const LOGFONTW * LogFont, Byte = SYMBOL_CHARSET; } } +#endif if (Byte != TM->tmCharSet) { @@ -6442,7 +6564,7 @@ NtGdiExtTextOutW( /* Probe and copy the string */ ProbeForRead(UnsafeString, StringSize, 1); - memcpy((PVOID)SafeString, UnsafeString, StringSize); + RtlCopyMemory((PVOID)SafeString, UnsafeString, StringSize); /* If we have Dx values... */ if (UnsafeDx) @@ -6450,7 +6572,7 @@ NtGdiExtTextOutW( /* ... probe and copy them */ SafeDx = Buffer; ProbeForRead(UnsafeDx, DxSize, 1); - memcpy(SafeDx, UnsafeDx, DxSize); + RtlCopyMemory(SafeDx, UnsafeDx, DxSize); } } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
5 years, 5 months
1
0
0
0
[reactos] 02/02: [SRVSVC] Make the server service stoppable.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eab73ad1a4613c79af7f8…
commit eab73ad1a4613c79af7f8eed45d3b4497ec08dfe Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sat Jul 20 22:48:17 2019 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sat Jul 20 22:48:17 2019 +0200 [SRVSVC] Make the server service stoppable. --- base/services/srvsvc/srvsvc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base/services/srvsvc/srvsvc.c b/base/services/srvsvc/srvsvc.c index 1c3710547b1..a4e77f2c8f8 100644 --- a/base/services/srvsvc/srvsvc.c +++ b/base/services/srvsvc/srvsvc.c @@ -60,6 +60,9 @@ UpdateServiceStatus(DWORD dwState) else ServiceStatus.dwWaitHint = 0; + if (dwState == SERVICE_RUNNING) + ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; + SetServiceStatus(ServiceStatusHandle, &ServiceStatus); }
5 years, 5 months
1
0
0
0
[reactos] 01/02: [WKSSVC] Make the workstation service stoppable.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4073a8c58db8441489f14…
commit 4073a8c58db8441489f142b65f088dfd28c9c2f7 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sat Jul 20 22:43:39 2019 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sat Jul 20 22:43:39 2019 +0200 [WKSSVC] Make the workstation service stoppable. --- base/services/wkssvc/wkssvc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base/services/wkssvc/wkssvc.c b/base/services/wkssvc/wkssvc.c index 5200570256b..eba9053e5e0 100644 --- a/base/services/wkssvc/wkssvc.c +++ b/base/services/wkssvc/wkssvc.c @@ -57,6 +57,9 @@ UpdateServiceStatus(DWORD dwState) else ServiceStatus.dwWaitHint = 0; + if (dwState == SERVICE_RUNNING) + ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; + SetServiceStatus(ServiceStatusHandle, &ServiceStatus); }
5 years, 5 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
15
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Results per page:
10
25
50
100
200