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
August 2014
----- 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
16 participants
226 discussions
Start a n
N
ew thread
[tfaber] 63887: [SHELL32] - Don't fail on NULL array pointer if count is zero CORE-8443 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Aug 14 22:43:10 2014 New Revision: 63887 URL:
http://svn.reactos.org/svn/reactos?rev=63887&view=rev
Log: [SHELL32] - Don't fail on NULL array pointer if count is zero CORE-8443 #resolve Modified: trunk/reactos/dll/win32/shell32/defcontextmenu.cpp Modified: trunk/reactos/dll/win32/shell32/defcontextmenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/defconte…
============================================================================== --- trunk/reactos/dll/win32/shell32/defcontextmenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/defcontextmenu.cpp [iso-8859-1] Thu Aug 14 22:43:10 2014 @@ -150,7 +150,7 @@ m_cidl = pdcm->cidl; m_apidl = const_cast<PCUITEMID_CHILD_ARRAY>(_ILCopyaPidl(pdcm->apidl, m_cidl)); - if (!m_apidl) + if (m_cidl && !m_apidl) return E_OUTOFMEMORY; m_psf = pdcm->psf; m_psf->AddRef();
10 years, 4 months
1
0
0
0
[hbelusca] 63886: Fourth partial merge of the condrv_restructure branch, with fonts improvements. CORE-8439 #resolve #comment r63885 merged to trunk in r63886.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Thu Aug 14 20:23:03 2014 New Revision: 63886 URL:
http://svn.reactos.org/svn/reactos?rev=63886&view=rev
Log: Fourth partial merge of the condrv_restructure branch, with fonts improvements. CORE-8439 #resolve #comment r63885 merged to trunk in r63886. Modified: trunk/reactos/ (props changed) trunk/reactos/dll/cpl/console/console.c trunk/reactos/dll/cpl/console/layout.c trunk/reactos/dll/win32/kernel32/client/console/console.c trunk/reactos/win32ss/user/winsrv/consrv/alias.c trunk/reactos/win32ss/user/winsrv/consrv/alias.h trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c trunk/reactos/win32ss/user/winsrv/consrv/coninput.c trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c trunk/reactos/win32ss/user/winsrv/consrv/console.c trunk/reactos/win32ss/user/winsrv/consrv/consrv.h trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/fullscreen.c trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c trunk/reactos/win32ss/user/winsrv/consrv/frontends/input.c trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.h trunk/reactos/win32ss/user/winsrv/consrv/handle.c trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h trunk/reactos/win32ss/user/winsrv/consrv/include/conio_winsrv.h trunk/reactos/win32ss/user/winsrv/consrv/lineinput.c trunk/reactos/win32ss/user/winsrv/consrv/lineinput.h trunk/reactos/win32ss/user/winsrv/consrv/subsysreg.c Propchange: trunk/reactos/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Aug 14 20:23:03 2014 @@ -3,7 +3,7 @@ /branches/GSoC_2011/TcpIpDriver:51551-53074,53076-53119 /branches/GSoC_Network:51545-51546 /branches/cmake-bringup:50484,50693,50719,51544-52564 -/branches/condrv_restructure:63104-63865 +/branches/condrv_restructure:63104-63885 /branches/header-work:45691-47721 /branches/kd++:58883-58973 /branches/ntvdm:59241-63176 Modified: trunk/reactos/dll/cpl/console/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/console.c?…
============================================================================== --- trunk/reactos/dll/cpl/console/console.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/console.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -117,7 +117,8 @@ GuiInfo->FontFamily = FF_DONTCARE; GuiInfo->FontSize.X = 0; GuiInfo->FontSize.Y = 0; - GuiInfo->FontWeight = FW_DONTCARE; + GuiInfo->FontWeight = FW_NORMAL; // HACK: !! + // GuiInfo->FontWeight = FW_DONTCARE; GuiInfo->FullScreen = FALSE; GuiInfo->ShowWindow = SW_SHOWNORMAL; Modified: trunk/reactos/dll/cpl/console/layout.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/layout.c?r…
============================================================================== --- trunk/reactos/dll/cpl/console/layout.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/layout.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -121,7 +121,7 @@ if (!hBrush) return FALSE; Font = CreateFontW(GuiInfo->FontSize.Y, - 0, // GuiInfo->FontSize.X, + GuiInfo->FontSize.X, 0, TA_BASELINE, GuiInfo->FontWeight, @@ -131,8 +131,8 @@ OEM_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, - NONANTIALIASED_QUALITY, - FIXED_PITCH | GuiInfo->FontFamily /* FF_DONTCARE */, + DEFAULT_QUALITY, // NONANTIALIASED_QUALITY ; ANTIALIASED_QUALITY + FIXED_PITCH | GuiInfo->FontFamily, GuiInfo->FaceName); if (Font == NULL) { Modified: trunk/reactos/dll/win32/kernel32/client/console/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/console/console.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/console/console.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -561,7 +561,7 @@ /* - * @unimplemented (Undocumented) + * @implemented (Undocumented) */ HANDLE WINAPI Modified: trunk/reactos/win32ss/user/winsrv/consrv/alias.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/alias.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/alias.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -102,7 +102,7 @@ /* PRIVATE FUNCTIONS **********************************************************/ static PALIAS_HEADER -IntFindAliasHeader(PCONSOLE Console, +IntFindAliasHeader(PCONSRV_CONSOLE Console, PVOID ExeName, USHORT ExeLength, BOOLEAN UnicodeExe) @@ -149,7 +149,7 @@ } static PALIAS_HEADER -IntCreateAliasHeader(PCONSOLE Console, +IntCreateAliasHeader(PCONSRV_CONSOLE Console, PVOID ExeName, USHORT ExeLength, BOOLEAN UnicodeExe) @@ -217,7 +217,7 @@ } static PALIAS_ENTRY -IntGetAliasEntry(PCONSOLE Console, +IntGetAliasEntry(PCONSRV_CONSOLE Console, PALIAS_HEADER Header, PVOID Source, USHORT SourceLength, @@ -266,7 +266,7 @@ } static PALIAS_ENTRY -IntCreateAliasEntry(PCONSOLE Console, +IntCreateAliasEntry(PCONSRV_CONSOLE Console, PVOID Source, USHORT SourceLength, PVOID Target, @@ -425,7 +425,7 @@ } VOID -IntDeleteAllAliases(PCONSOLE Console) +IntDeleteAllAliases(PCONSRV_CONSOLE Console) { PALIAS_HEADER Header, NextHeader; PALIAS_ENTRY Entry, NextEntry; @@ -449,7 +449,7 @@ { NTSTATUS Status; PCONSOLE_ADDGETALIAS ConsoleAliasRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ConsoleAliasRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; PALIAS_HEADER Header; PALIAS_ENTRY Entry; PVOID lpTarget; @@ -538,7 +538,7 @@ { NTSTATUS Status; PCONSOLE_ADDGETALIAS ConsoleAliasRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ConsoleAliasRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; PALIAS_HEADER Header; PALIAS_ENTRY Entry; UINT Length; @@ -629,7 +629,7 @@ { NTSTATUS Status; PCONSOLE_GETALLALIASES GetAllAliasesRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetAllAliasesRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; ULONG BytesWritten = 0; PALIAS_HEADER Header; @@ -734,7 +734,7 @@ { NTSTATUS Status; PCONSOLE_GETALLALIASESLENGTH GetAllAliasesLengthRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetAllAliasesLengthRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; PALIAS_HEADER Header; DPRINT1("SrvGetConsoleAliasesLength entered ApiMessage %p\n", ApiMessage); @@ -774,7 +774,7 @@ { NTSTATUS Status; PCONSOLE_GETALIASESEXES GetAliasesExesRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetAliasesExesRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; UINT BytesWritten = 0; DPRINT1("SrvGetConsoleAliasExes entered\n"); @@ -860,7 +860,7 @@ { NTSTATUS Status; PCONSOLE_GETALIASESEXESLENGTH GetAliasesExesLengthRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetAliasesExesLengthRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; DPRINT1("SrvGetConsoleAliasExesLength entered ApiMessage %p\n", ApiMessage); Modified: trunk/reactos/win32ss/user/winsrv/consrv/alias.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/alias.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/alias.h [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -9,4 +9,4 @@ #pragma once -VOID IntDeleteAllAliases(PCONSOLE Console); +VOID IntDeleteAllAliases(PCONSRV_CONSOLE Console); Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -233,7 +233,6 @@ /* Initialize the terminal interface */ ResetTerminal(Console); - memcpy(Console->Colors, ConsoleInfo->Colors, sizeof(ConsoleInfo->Colors)); Console->ConsoleSize = ConsoleInfo->ConsoleSize; Console->FixedSize = FALSE; // Value by default; is reseted by the terminals if needed. Modified: trunk/reactos/win32ss/user/winsrv/consrv/coninput.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -40,7 +40,7 @@ * This pre-processing code MUST be IN consrv ONLY */ /* static */ ULONG -PreprocessInput(PCONSOLE Console, +PreprocessInput(PCONSRV_CONSOLE Console, PINPUT_RECORD InputEvent, ULONG NumEventsToWrite) { @@ -102,7 +102,7 @@ * This post-processing code MUST be IN consrv ONLY */ /* static */ VOID -PostprocessInput(PCONSOLE Console) +PostprocessInput(PCONSRV_CONSOLE Console) { CsrNotifyWait(&Console->ReadWaitQueue, FALSE, Modified: trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -170,7 +170,7 @@ NTSTATUS Status = STATUS_INVALID_PARAMETER; PCONSOLE_CREATESCREENBUFFER CreateScreenBufferRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.CreateScreenBufferRequest; PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(CsrGetClientThread()->Process); - PCONSOLE Console; + PCONSRV_CONSOLE Console; PCONSOLE_SCREEN_BUFFER Buff; PVOID ScreenBufferInfo = NULL; Modified: trunk/reactos/win32ss/user/winsrv/consrv/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/console.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/console.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -26,7 +26,7 @@ /* GLOBALS ********************************************************************/ static ULONG ConsoleListSize; -static PCONSOLE* ConsoleList; /* The list of the ConSrv consoles */ +static PCONSRV_CONSOLE* ConsoleList; /* The list of the ConSrv consoles */ static RTL_RESOURCE ListLock; #define ConSrvLockConsoleListExclusive() \ @@ -41,13 +41,13 @@ static NTSTATUS InsertConsole(OUT PHANDLE Handle, - IN PCONSOLE Console) + IN PCONSRV_CONSOLE Console) { #define CONSOLE_HANDLES_INCREMENT 2 * 3 NTSTATUS Status = STATUS_SUCCESS; ULONG i = 0; - PCONSOLE* Block; + PCONSRV_CONSOLE* Block; ASSERT( (ConsoleList == NULL && ConsoleListSize == 0) || (ConsoleList != NULL && ConsoleListSize != 0) ); @@ -70,7 +70,7 @@ /* Allocate a new handles table */ Block = ConsoleAllocHeap(HEAP_ZERO_MEMORY, (ConsoleListSize + - CONSOLE_HANDLES_INCREMENT) * sizeof(PCONSOLE)); + CONSOLE_HANDLES_INCREMENT) * sizeof(PCONSRV_CONSOLE)); if (Block == NULL) { Status = STATUS_UNSUCCESSFUL; @@ -83,7 +83,7 @@ /* Copy the handles from the old table to the new one */ RtlCopyMemory(Block, ConsoleList, - ConsoleListSize * sizeof(PCONSOLE)); + ConsoleListSize * sizeof(PCONSRV_CONSOLE)); ConsoleFreeHeap(ConsoleList); } ConsoleList = Block; @@ -105,7 +105,7 @@ RemoveConsoleByHandle(IN HANDLE Handle) { NTSTATUS Status = STATUS_SUCCESS; - PCONSOLE Console; + PCONSRV_CONSOLE Console; BOOLEAN ValidHandle = ((HandleToULong(Handle) & 0x3) == 0x3); ULONG Index = HandleToULong(Handle) >> 2; @@ -135,7 +135,7 @@ #endif static NTSTATUS -RemoveConsoleByPointer(IN PCONSOLE Console) +RemoveConsoleByPointer(IN PCONSRV_CONSOLE Console) { ULONG i = 0; @@ -162,13 +162,13 @@ } BOOLEAN NTAPI -ConSrvValidateConsole(OUT PCONSOLE* Console, +ConSrvValidateConsole(OUT PCONSRV_CONSOLE* Console, IN HANDLE ConsoleHandle, IN CONSOLE_STATE ExpectedState, IN BOOLEAN LockConsole) { BOOLEAN RetVal = FALSE; - PCONSOLE ValidatedConsole; + PCONSRV_CONSOLE ValidatedConsole; BOOLEAN ValidHandle = ((HandleToULong(ConsoleHandle) & 0x3) == 0x3); ULONG Index = HandleToULong(ConsoleHandle) >> 2; @@ -210,14 +210,14 @@ /* PRIVATE FUNCTIONS **********************************************************/ VOID -ConioPause(PCONSOLE Console, UINT Flags) +ConioPause(PCONSRV_CONSOLE Console, UINT Flags) { Console->PauseFlags |= Flags; ConDrvPause(Console); } VOID -ConioUnpause(PCONSOLE Console, UINT Flags) +ConioUnpause(PCONSRV_CONSOLE Console, UINT Flags) { Console->PauseFlags &= ~Flags; @@ -239,11 +239,11 @@ NTSTATUS ConSrvGetConsole(IN PCONSOLE_PROCESS_DATA ProcessData, - OUT PCONSOLE* Console, + OUT PCONSRV_CONSOLE* Console, IN BOOLEAN LockConsole) { NTSTATUS Status = STATUS_INVALID_HANDLE; - PCONSOLE GrabConsole; + PCONSRV_CONSOLE GrabConsole; // if (Console == NULL) return STATUS_INVALID_PARAMETER; ASSERT(Console); @@ -266,7 +266,7 @@ } VOID -ConSrvReleaseConsole(IN PCONSOLE Console, +ConSrvReleaseConsole(IN PCONSRV_CONSOLE Console, IN BOOLEAN WasConsoleLocked) { LONG RefCount = 0; @@ -319,13 +319,13 @@ NTSTATUS NTAPI ConSrvInitConsole(OUT PHANDLE NewConsoleHandle, - OUT PCONSOLE* NewConsole, + OUT PCONSRV_CONSOLE* NewConsole, IN OUT PCONSOLE_START_INFO ConsoleStartInfo, IN ULONG ConsoleLeaderProcessId) { NTSTATUS Status; HANDLE ConsoleHandle; - PCONSOLE Console; + PCONSRV_CONSOLE Console; CONSOLE_INFO ConsoleInfo; SIZE_T Length = 0; @@ -429,6 +429,9 @@ Console->QuickEdit = ConsoleInfo.QuickEdit; + /* Colour table */ + memcpy(Console->Colors, ConsoleInfo.Colors, sizeof(ConsoleInfo.Colors)); + /* Attach the ConSrv terminal to the console */ Status = ConDrvRegisterTerminal(Console, &Terminal); if (!NT_SUCCESS(Status)) @@ -450,7 +453,7 @@ } VOID NTAPI -ConSrvDeleteConsole(PCONSOLE Console) +ConSrvDeleteConsole(PCONSRV_CONSOLE Console) { DPRINT("ConSrvDeleteConsole\n"); @@ -528,7 +531,7 @@ } PCONSOLE_PROCESS_DATA NTAPI -ConSrvGetConsoleLeaderProcess(IN PCONSOLE Console) +ConSrvGetConsoleLeaderProcess(IN PCONSRV_CONSOLE Console) { if (Console == NULL) return NULL; @@ -538,7 +541,7 @@ } NTSTATUS NTAPI -ConSrvGetConsoleProcessList(IN PCONSOLE Console, +ConSrvGetConsoleProcessList(IN PCONSRV_CONSOLE Console, IN OUT PULONG ProcessIdsList, IN ULONG MaxIdListItems, OUT PULONG ProcessIdsTotal) @@ -567,7 +570,7 @@ // ConSrvGenerateConsoleCtrlEvent NTSTATUS NTAPI -ConSrvConsoleProcessCtrlEvent(IN PCONSOLE Console, +ConSrvConsoleProcessCtrlEvent(IN PCONSRV_CONSOLE Console, IN ULONG ProcessGroupId, IN ULONG CtrlEvent) { @@ -795,7 +798,7 @@ { NTSTATUS Status; PCONSOLE_GETSETCONSOLETITLE TitleRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.TitleRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; if (!CsrValidateMessageBuffer(ApiMessage, (PVOID)&TitleRequest->Title, @@ -830,7 +833,7 @@ { NTSTATUS Status; PCONSOLE_GETSETCONSOLETITLE TitleRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.TitleRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; if (!CsrValidateMessageBuffer(ApiMessage, (PVOID)&TitleRequest->Title, @@ -865,7 +868,7 @@ { NTSTATUS Status; PCONSOLE_GETINPUTOUTPUTCP GetConsoleCPRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetConsoleCPRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; DPRINT("SrvGetConsoleCP, getting %s Code Page\n", GetConsoleCPRequest->OutputCP ? "Output" : "Input"); @@ -889,7 +892,7 @@ { NTSTATUS Status = STATUS_INVALID_PARAMETER; PCONSOLE_SETINPUTOUTPUTCP SetConsoleCPRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetConsoleCPRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; DPRINT("SrvSetConsoleCP, setting %s Code Page\n", SetConsoleCPRequest->OutputCP ? "Output" : "Input"); @@ -909,7 +912,7 @@ { NTSTATUS Status; PCONSOLE_GETPROCESSLIST GetProcessListRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetProcessListRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; if (!CsrValidateMessageBuffer(ApiMessage, (PVOID)&GetProcessListRequest->ProcessIdsList, @@ -935,7 +938,7 @@ { NTSTATUS Status; PCONSOLE_GENERATECTRLEVENT GenerateCtrlEventRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GenerateCtrlEventRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; @@ -952,7 +955,7 @@ { NTSTATUS Status; PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(CsrGetClientThread()->Process); - PCONSOLE Console; + PCONSRV_CONSOLE Console; Status = ConSrvGetConsole(ProcessData, &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; @@ -979,7 +982,7 @@ { NTSTATUS Status; PCONSOLE_GETMOUSEINFO GetMouseInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetMouseInfoRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; @@ -1001,7 +1004,7 @@ { NTSTATUS Status; PCONSOLE_GETKBDLAYOUTNAME GetKbdLayoutNameRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetKbdLayoutNameRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; Modified: trunk/reactos/win32ss/user/winsrv/consrv/consrv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/consrv.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/consrv.h [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -67,6 +67,7 @@ } CONSOLE_PROCESS_DATA, *PCONSOLE_PROCESS_DATA; #include "include/conio.h" +// #include "include/conio_winsrv.h" #include "include/console.h" #include "include/settings.h" #include "include/term.h" Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -31,7 +31,7 @@ */ #if 0 static NTSTATUS -SetConsoleHardwareState(PCONSOLE Console, ULONG ConsoleHwState) +SetConsoleHardwareState(PCONSRV_CONSOLE Console, ULONG ConsoleHwState) { DPRINT1("Console Hardware State: %d\n", ConsoleHwState); @@ -58,7 +58,7 @@ NTSTATUS Status; PCONSOLE_GETSETHWSTATE HardwareStateRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.HardwareStateRequest; PCONSOLE_SCREEN_BUFFER Buff; - PCONSOLE Console; + PCONSRV_CONSOLE Console; Status = ConSrvGetTextModeBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process), HardwareStateRequest->OutputHandle, @@ -88,7 +88,7 @@ NTSTATUS Status; PCONSOLE_GETSETHWSTATE HardwareStateRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.HardwareStateRequest; PCONSOLE_SCREEN_BUFFER Buff; - PCONSOLE Console; + PCONSRV_CONSOLE Console; Status = ConSrvGetTextModeBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process), HardwareStateRequest->OutputHandle, @@ -117,7 +117,7 @@ { NTSTATUS Status; PCONSOLE_GETDISPLAYMODE GetDisplayModeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetDisplayModeRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); @@ -133,7 +133,7 @@ { NTSTATUS Status; PCONSOLE_SETDISPLAYMODE SetDisplayModeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetDisplayModeRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; PCONSOLE_SCREEN_BUFFER Buff; Status = ConSrvGetScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process), @@ -164,7 +164,7 @@ NTSTATUS Status; PCONSOLE_GETLARGESTWINDOWSIZE GetLargestWindowSizeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetLargestWindowSizeRequest; PCONSOLE_SCREEN_BUFFER Buff; - PCONSOLE Console; + PCONSRV_CONSOLE Console; Status = ConSrvGetTextModeBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process), GetLargestWindowSizeRequest->OutputHandle, @@ -184,7 +184,7 @@ { NTSTATUS Status; PCONSOLE_SHOWCURSOR ShowCursorRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ShowCursorRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; PCONSOLE_SCREEN_BUFFER Buff; Status = ConSrvGetScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process), @@ -207,7 +207,7 @@ NTSTATUS Status; BOOL Success; PCONSOLE_SETCURSOR SetCursorRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetCursorRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; PCONSOLE_SCREEN_BUFFER Buff; // FIXME: Tests show that this function is used only for graphics screen buffers @@ -232,7 +232,7 @@ { NTSTATUS Status; PCONSOLE_MENUCONTROL MenuControlRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.MenuControlRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; PCONSOLE_SCREEN_BUFFER Buff; Status = ConSrvGetScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process), @@ -257,7 +257,7 @@ NTSTATUS Status; BOOL Success; PCONSOLE_SETMENUCLOSE SetMenuCloseRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetMenuCloseRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); @@ -273,7 +273,7 @@ { NTSTATUS Status; PCONSOLE_GETWINDOW GetWindowRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetWindowRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; @@ -288,7 +288,7 @@ { NTSTATUS Status; PCONSOLE_SETICON SetIconRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetIconRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; @@ -305,7 +305,7 @@ { NTSTATUS Status; PCONSOLE_GETSELECTIONINFO GetSelectionInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetSelectionInfoRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -282,7 +282,7 @@ } static VOID -SendMenuEvent(PCONSOLE Console, UINT CmdId) +SendMenuEvent(PCONSRV_CONSOLE Console, UINT CmdId) { INPUT_RECORD er; @@ -366,7 +366,7 @@ OnCommand(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam) { LRESULT Ret = TRUE; - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; /* * In case the selected menu item belongs to the user-reserved menu id range, @@ -486,15 +486,166 @@ // to: InvalidateRect(GuiData->hWindow, NULL, TRUE); } + +VOID +DeleteFonts(PGUI_CONSOLE_DATA GuiData) +{ + ULONG i; + for (i = 0; i < sizeof(GuiData->Font) / sizeof(GuiData->Font[0]); ++i) + { + if (GuiData->Font[i] != NULL) DeleteObject(GuiData->Font[i]); + GuiData->Font[i] = NULL; + } +} + +static HFONT +CreateDerivedFont(HFONT OrgFont, + // COORD FontSize, + ULONG FontWeight, + // BOOLEAN bItalic, + BOOLEAN bUnderline, + BOOLEAN bStrikeOut) +{ + LOGFONT lf; + + /* Initialize the LOGFONT structure */ + RtlZeroMemory(&lf, sizeof(lf)); + + /* Retrieve the details of the current font */ + if (GetObject(OrgFont, sizeof(lf), &lf) == 0) + return NULL; + + /* Change the font attributes */ + // lf.lfHeight = FontSize.Y; + // lf.lfWidth = FontSize.X; + lf.lfWeight = FontWeight; + // lf.lfItalic = bItalic; + lf.lfUnderline = bUnderline; + lf.lfStrikeOut = bStrikeOut; + + /* Build a new font */ + return CreateFontIndirect(&lf); +} + +BOOL +InitFonts(PGUI_CONSOLE_DATA GuiData, + LPWSTR FaceName, // Points to a WCHAR array of LF_FACESIZE elements. + ULONG FontFamily, + COORD FontSize, + ULONG FontWeight) +{ + HDC hDC; + HFONT OldFont, NewFont; + TEXTMETRICW Metrics; + SIZE CharSize; + + /* + * Initialize a new NORMAL font and get its metrics. + */ + + NewFont = CreateFontW(FontSize.Y, + FontSize.X, + 0, + TA_BASELINE, + FontWeight, + FALSE, + FALSE, + FALSE, + OEM_CHARSET, + OUT_DEFAULT_PRECIS, + CLIP_DEFAULT_PRECIS, + DEFAULT_QUALITY, // NONANTIALIASED_QUALITY ; ANTIALIASED_QUALITY + FIXED_PITCH | FontFamily, + FaceName); + if (NewFont == NULL) + { + DPRINT1("InitFonts: CreateFontW failed\n"); + return FALSE; + } + + hDC = GetDC(GuiData->hWindow); + if (hDC == NULL) + { + DPRINT1("InitFonts: GetDC failed\n"); + DeleteObject(NewFont); + return FALSE; + } + + OldFont = SelectObject(hDC, NewFont); + if (OldFont == NULL) + { + DPRINT1("InitFonts: SelectObject failed\n"); + ReleaseDC(GuiData->hWindow, hDC); + DeleteObject(NewFont); + return FALSE; + } + + if (!GetTextMetricsW(hDC, &Metrics)) + { + DPRINT1("InitFonts: GetTextMetrics failed\n"); + SelectObject(hDC, OldFont); + ReleaseDC(GuiData->hWindow, hDC); + DeleteObject(NewFont); + return FALSE; + } + GuiData->CharWidth = Metrics.tmMaxCharWidth; + GuiData->CharHeight = Metrics.tmHeight + Metrics.tmExternalLeading; + + /* Measure real char width more precisely if possible. */ + if (GetTextExtentPoint32W(hDC, L"R", 1, &CharSize)) + GuiData->CharWidth = CharSize.cx; + + SelectObject(hDC, OldFont); + ReleaseDC(GuiData->hWindow, hDC); + + /* + * Initialization succeeded. + */ + // Delete all the old fonts first. + DeleteFonts(GuiData); + GuiData->Font[FONT_NORMAL] = NewFont; + + /* + * Now build the other fonts (bold, underlined, mixed). + */ + GuiData->Font[FONT_BOLD] = + CreateDerivedFont(GuiData->Font[FONT_NORMAL], + FontWeight < FW_BOLD ? FW_BOLD : FontWeight, + FALSE, + FALSE); + GuiData->Font[FONT_UNDERLINE] = + CreateDerivedFont(GuiData->Font[FONT_NORMAL], + FontWeight, + TRUE, + FALSE); + GuiData->Font[FONT_BOLD | FONT_UNDERLINE] = + CreateDerivedFont(GuiData->Font[FONT_NORMAL], + FontWeight < FW_BOLD ? FW_BOLD : FontWeight, + TRUE, + FALSE); + + /* + * Save the settings. + */ + if (FaceName != GuiData->GuiInfo.FaceName) + { + SIZE_T Length = min(wcslen(FaceName) + 1, LF_FACESIZE); // wcsnlen + wcsncpy(GuiData->GuiInfo.FaceName, FaceName, LF_FACESIZE); + GuiData->GuiInfo.FaceName[Length] = L'\0'; // NULL-terminate + } + GuiData->GuiInfo.FontFamily = FontFamily; + GuiData->GuiInfo.FontSize = FontSize; + GuiData->GuiInfo.FontWeight = FontWeight; + + return TRUE; +} + + static BOOL OnNcCreate(HWND hWnd, LPCREATESTRUCTW Create) { PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA)Create->lpCreateParams; - PCONSOLE Console; - HDC hDC; - HFONT OldFont; - TEXTMETRICW Metrics; - SIZE CharSize; + PCONSRV_CONSOLE Console; if (NULL == GuiData) { @@ -506,67 +657,18 @@ GuiData->hWindow = hWnd; - GuiData->Font = CreateFontW(GuiData->GuiInfo.FontSize.Y, - 0, // GuiData->GuiInfo.FontSize.X, - 0, - TA_BASELINE, - GuiData->GuiInfo.FontWeight, - FALSE, - FALSE, - FALSE, - OEM_CHARSET, - OUT_DEFAULT_PRECIS, - CLIP_DEFAULT_PRECIS, - NONANTIALIASED_QUALITY, - FIXED_PITCH | GuiData->GuiInfo.FontFamily /* FF_DONTCARE */, - GuiData->GuiInfo.FaceName); - - if (NULL == GuiData->Font) - { - DPRINT1("GuiConsoleNcCreate: CreateFont failed\n"); + /* Initialize the fonts */ + if (!InitFonts(GuiData, + GuiData->GuiInfo.FaceName, + GuiData->GuiInfo.FontFamily, + GuiData->GuiInfo.FontSize, + GuiData->GuiInfo.FontWeight)) + { + DPRINT1("GuiConsoleNcCreate: InitFonts failed\n"); GuiData->hWindow = NULL; SetEvent(GuiData->hGuiInitEvent); return FALSE; } - hDC = GetDC(GuiData->hWindow); - if (NULL == hDC) - { - DPRINT1("GuiConsoleNcCreate: GetDC failed\n"); - DeleteObject(GuiData->Font); - GuiData->hWindow = NULL; - SetEvent(GuiData->hGuiInitEvent); - return FALSE; - } - OldFont = SelectObject(hDC, GuiData->Font); - if (NULL == OldFont) - { - DPRINT1("GuiConsoleNcCreate: SelectObject failed\n"); - ReleaseDC(GuiData->hWindow, hDC); - DeleteObject(GuiData->Font); - GuiData->hWindow = NULL; - SetEvent(GuiData->hGuiInitEvent); - return FALSE; - } - if (!GetTextMetricsW(hDC, &Metrics)) - { - DPRINT1("GuiConsoleNcCreate: GetTextMetrics failed\n"); - SelectObject(hDC, OldFont); - ReleaseDC(GuiData->hWindow, hDC); - DeleteObject(GuiData->Font); - GuiData->hWindow = NULL; - SetEvent(GuiData->hGuiInitEvent); - return FALSE; - } - GuiData->CharWidth = Metrics.tmMaxCharWidth; - GuiData->CharHeight = Metrics.tmHeight + Metrics.tmExternalLeading; - - /* Measure real char width more precisely if possible. */ - if (GetTextExtentPoint32W(hDC, L"R", 1, &CharSize)) - GuiData->CharWidth = CharSize.cx; - - SelectObject(hDC, OldFont); - - ReleaseDC(GuiData->hWindow, hDC); /* Initialize the terminal framebuffer */ GuiData->hMemDC = CreateCompatibleDC(NULL); @@ -647,7 +749,7 @@ static VOID OnFocus(PGUI_CONSOLE_DATA GuiData, BOOL SetFocus) { - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; INPUT_RECORD er; if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; @@ -814,7 +916,7 @@ PCOORD SelectionAnchor OPTIONAL, PCOORD coord) { - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; HRGN oldRgn = CreateSelectionRgn(GuiData, GuiData->LineSelection, &GuiData->Selection.dwSelectionAnchor, &GuiData->Selection.srSelection); @@ -1039,7 +1141,7 @@ static VOID OnKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) { - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; PCONSOLE_SCREEN_BUFFER ActiveBuffer; if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; @@ -1204,7 +1306,7 @@ static VOID OnTimer(PGUI_CONSOLE_DATA GuiData) { - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; PCONSOLE_SCREEN_BUFFER Buff; SetTimer(GuiData->hWindow, CONGUI_UPDATE_TIMER, CURSOR_BLINK_TIME, NULL); @@ -1309,7 +1411,7 @@ static BOOL OnClose(PGUI_CONSOLE_DATA GuiData) { - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return TRUE; @@ -1341,7 +1443,7 @@ if (GuiData->hMemDC ) DeleteDC(GuiData->hMemDC); if (GuiData->hBitmap) DeleteObject(GuiData->hBitmap); // if (GuiData->hSysPalette) DeleteObject(GuiData->hSysPalette); - if (GuiData->Font) DeleteObject(GuiData->Font); + DeleteFonts(GuiData); } /* Free the GuiData registration */ @@ -1380,7 +1482,7 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) { BOOL Err = FALSE; - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; // FIXME: It's here that we need to check whether we has focus or not // and whether we are in edit mode or not, to know if we need to deal @@ -1735,7 +1837,7 @@ static VOID OnGetMinMaxInfo(PGUI_CONSOLE_DATA GuiData, PMINMAXINFO minMaxInfo) { - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; PCONSOLE_SCREEN_BUFFER ActiveBuffer; DWORD windx, windy; UINT WidthUnit, HeightUnit; @@ -1767,7 +1869,7 @@ static VOID OnSize(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam) { - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; @@ -1872,7 +1974,7 @@ static LRESULT OnScroll(PGUI_CONSOLE_DATA GuiData, UINT uMsg, WPARAM wParam) { - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; PCONSOLE_SCREEN_BUFFER Buff; SCROLLINFO sInfo; int fnBar; @@ -1983,7 +2085,7 @@ { LRESULT Result = 0; PGUI_CONSOLE_DATA GuiData = NULL; - PCONSOLE Console = NULL; + PCONSRV_CONSOLE Console = NULL; /* * - If it's the first time we create a window for the terminal, Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -21,6 +21,17 @@ #define PM_CONSOLE_BEEP (WM_APP + 4) #define PM_CONSOLE_SET_TITLE (WM_APP + 5) +/* +typedef struct _CONSOLE_FONT +{ + HFONT Font; + ULONG Flag; +} CONSOLE_FONT, *PCONSOLE_FONT; +*/ +#define FONT_NORMAL 0x00 +#define FONT_BOLD 0x01 +#define FONT_UNDERLINE 0x02 +#define FONT_MAXNO 0x04 typedef struct _GUI_CONSOLE_DATA { @@ -56,12 +67,12 @@ // PVOID ScreenBuffer; /* Hardware screen buffer */ - HFONT Font; - UINT CharWidth; - UINT CharHeight; + HFONT Font[FONT_MAXNO]; + UINT CharWidth; /* The character width and height should be the same for */ + UINT CharHeight; /* both normal and bold/underlined fonts... */ /*****************************************************/ - PCONSOLE Console; /* Pointer to the owned console */ + PCONSRV_CONSOLE Console; /* Pointer to the owned console */ PCONSOLE_SCREEN_BUFFER ActiveBuffer; /* Pointer to the active screen buffer (then maybe the previous Console member is redundant?? Or not...) */ CONSOLE_SELECTION_INFO Selection; /* Contains information about the selection */ COORD dwSelectionCursor; /* Selection cursor position, most of the time different from Selection.dwSelectionAnchor */ Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/fullscreen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/fullscreen.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/fullscreen.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -48,7 +48,7 @@ VOID SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen) { - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; /* * See: @@ -174,7 +174,7 @@ VOID GuiConsoleSwitchFullScreen(PGUI_CONSOLE_DATA GuiData) { - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; BOOL FullScreen; if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -115,7 +115,7 @@ * This function supposes that the system clipboard was opened. */ - // PCONSOLE Console = Buffer->Header.Console; + // PCONSRV_CONSOLE Console = Buffer->Header.Console; UNIMPLEMENTED; } @@ -126,7 +126,7 @@ PRECT rcView, PRECT rcFramebuffer) { - PCONSOLE Console = Buffer->Header.Console; + PCONSRV_CONSOLE Console = Buffer->Header.Console; // ASSERT(Console == GuiData->Console); if (Buffer->BitMap == NULL) return; Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -16,9 +16,6 @@ #include "guiterm.h" #include "guisettings.h" - -VOID GuiConsoleMoveWindow(PGUI_CONSOLE_DATA GuiData); -VOID SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen); /* FUNCTIONS ******************************************************************/ @@ -199,14 +196,14 @@ // wcsncpy(TermInfo->FaceName, L"DejaVu Sans Mono", LF_FACESIZE); // TermInfo->FontSize = MAKELONG(8, 12); // 0x000C0008; // font is 8x12 // TermInfo->FontSize = MAKELONG(16, 16); // font is 16x16 - // TermInfo->FontWeight = FW_NORMAL; wcsncpy(TermInfo->FaceName, L"VGA", LF_FACESIZE); // HACK: !! // TermInfo->FaceName[0] = L'\0'; TermInfo->FontFamily = FF_DONTCARE; TermInfo->FontSize.X = 0; TermInfo->FontSize.Y = 0; - TermInfo->FontWeight = FW_DONTCARE; + TermInfo->FontWeight = FW_NORMAL; // HACK: !! + // TermInfo->FontWeight = FW_DONTCARE; TermInfo->FullScreen = FALSE; TermInfo->ShowWindow = SW_SHOWNORMAL; @@ -230,7 +227,7 @@ BOOL Defaults) { NTSTATUS Status; - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; PCONSOLE_PROCESS_DATA ProcessData; HANDLE hSection = NULL, hClientSection = NULL; @@ -418,99 +415,13 @@ return; } - - - -BOOL -ChangeFont(PGUI_CONSOLE_DATA GuiData, - LPWSTR FaceName, // Points to a WCHAR array of LF_FACESIZE elements. - ULONG FontFamily, - COORD FontSize, - ULONG FontWeight) -{ - HDC hDC; - HFONT OldFont, NewFont; - TEXTMETRICW Metrics; - SIZE CharSize; - SIZE_T Length; - - NewFont = CreateFontW(FontSize.Y, - 0, // FontSize.X, - 0, - TA_BASELINE, - FontWeight, - FALSE, - FALSE, - FALSE, - OEM_CHARSET, - OUT_DEFAULT_PRECIS, - CLIP_DEFAULT_PRECIS, - NONANTIALIASED_QUALITY, - FIXED_PITCH | FontFamily /* FF_DONTCARE */, - FaceName); - if (NewFont == NULL) - { - DPRINT1("ChangeFont: CreateFont failed\n"); - return FALSE; - } - - hDC = GetDC(GuiData->hWindow); - if (hDC == NULL) - { - DPRINT1("ChangeFont: GetDC failed\n"); - DeleteObject(NewFont); - return FALSE; - } - - OldFont = SelectObject(hDC, NewFont); - if (OldFont == NULL) - { - DPRINT1("ChangeFont: SelectObject failed\n"); - ReleaseDC(GuiData->hWindow, hDC); - DeleteObject(NewFont); - return FALSE; - } - - if (!GetTextMetricsW(hDC, &Metrics)) - { - DPRINT1("ChangeFont: GetTextMetrics failed\n"); - SelectObject(hDC, OldFont); - ReleaseDC(GuiData->hWindow, hDC); - DeleteObject(NewFont); - return FALSE; - } - GuiData->CharWidth = Metrics.tmMaxCharWidth; - GuiData->CharHeight = Metrics.tmHeight + Metrics.tmExternalLeading; - - /* Measure real char width more precisely if possible. */ - if (GetTextExtentPoint32W(hDC, L"R", 1, &CharSize)) - GuiData->CharWidth = CharSize.cx; - - SelectObject(hDC, OldFont); - ReleaseDC(GuiData->hWindow, hDC); - - if (GuiData->Font != NULL) DeleteObject(GuiData->Font); - GuiData->Font = NewFont; - - Length = min(wcslen(FaceName) + 1, LF_FACESIZE); // wcsnlen - wcsncpy(GuiData->GuiInfo.FaceName, FaceName, LF_FACESIZE); - GuiData->GuiInfo.FaceName[Length] = L'\0'; // NULL-terminate - GuiData->GuiInfo.FontFamily = FontFamily; - GuiData->GuiInfo.FontSize = FontSize; - GuiData->GuiInfo.FontWeight = FontWeight; - - return TRUE; -} - - - VOID GuiApplyUserSettings(PGUI_CONSOLE_DATA GuiData, HANDLE hClientSection, BOOL SaveSettings) { NTSTATUS Status = STATUS_SUCCESS; - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; PCONSOLE_PROCESS_DATA ProcessData; HANDLE hSection = NULL; ULONG ViewSize = 0; @@ -586,11 +497,11 @@ // memcpy(&GuiData->GuiInfo, GuiInfo, sizeof(GUI_CONSOLE_INFO)); /* Change the font */ - ChangeFont(GuiData, - GuiInfo->FaceName, - GuiInfo->FontFamily, - GuiInfo->FontSize, - GuiInfo->FontWeight); + InitFonts(GuiData, + GuiInfo->FaceName, + GuiInfo->FontFamily, + GuiInfo->FontSize, + GuiInfo->FontWeight); // HACK, needed because changing font may change the size of the window /**/TermResizeTerminal(Console);/**/ @@ -654,7 +565,7 @@ HANDLE hClientSection) { NTSTATUS Status = STATUS_SUCCESS; - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; PCONSOLE_PROCESS_DATA ProcessData; HANDLE hSection = NULL; ULONG ViewSize = 0; @@ -768,11 +679,11 @@ // memcpy(&GuiData->GuiInfo, &GuiInfo, sizeof(GUI_CONSOLE_INFO)); /* Change the font */ - ChangeFont(GuiData, - GuiInfo.FaceName, - GuiInfo.FontFamily, - GuiInfo.FontSize, - GuiInfo.FontWeight); + InitFonts(GuiData, + GuiInfo.FaceName, + GuiInfo.FontFamily, + GuiInfo.FontSize, + GuiInfo.FontWeight); // HACK, needed because changing font may change the size of the window /**/TermResizeTerminal(Console);/**/ Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -29,7 +29,6 @@ typedef struct _GUI_CONSOLE_INFO { - // FONTSIGNATURE FontSignature; WCHAR FaceName[LF_FACESIZE]; ULONG FontFamily; COORD FontSize; Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -160,7 +160,7 @@ case PM_CREATE_CONSOLE: { PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA)lParam; - PCONSOLE Console = GuiData->Console; + PCONSRV_CONSOLE Console = GuiData->Console; RECT rcWnd; DPRINT("PM_CREATE_CONSOLE -- creating window\n"); @@ -394,9 +394,9 @@ static VOID NTAPI GuiDeinitFrontEnd(IN OUT PFRONTEND This); -NTSTATUS NTAPI +static NTSTATUS NTAPI GuiInitFrontEnd(IN OUT PFRONTEND This, - IN PCONSOLE Console) + IN PCONSRV_CONSOLE Console) { PGUI_INIT_INFO GuiInitInfo; PCONSOLE_INFO ConsoleInfo; Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -15,8 +15,23 @@ #include "conwnd.h" NTSTATUS GuiInitConsole(PCONSOLE Console, - /*IN*/ PCONSOLE_START_INFO ConsoleStartInfo, - PCONSOLE_INFO ConsoleInfo, - DWORD ProcessId, - LPCWSTR IconPath, - INT IconIndex); + /*IN*/ PCONSOLE_START_INFO ConsoleStartInfo, + PCONSOLE_INFO ConsoleInfo, + DWORD ProcessId, + LPCWSTR IconPath, + INT IconIndex); + +VOID +GuiConsoleMoveWindow(PGUI_CONSOLE_DATA GuiData); + +VOID +SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen); + +BOOL +InitFonts(PGUI_CONSOLE_DATA GuiData, + LPWSTR FaceName, // Points to a WCHAR array of LF_FACESIZE elements. + ULONG FontFamily, + COORD FontSize, + ULONG FontWeight); +VOID +DeleteFonts(PGUI_CONSOLE_DATA GuiData); Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -25,7 +25,7 @@ /* FUNCTIONS ******************************************************************/ static COLORREF -PaletteRGBFromAttrib(PCONSOLE Console, WORD Attribute) +PaletteRGBFromAttrib(PCONSRV_CONSOLE Console, WORD Attribute) { HPALETTE hPalette = Console->ActiveBuffer->PaletteHandle; PALETTEENTRY pe; @@ -34,44 +34,6 @@ GetPaletteEntries(hPalette, Attribute, 1, &pe); return PALETTERGB(pe.peRed, pe.peGreen, pe.peBlue); -} - -static HFONT -ChangeFontAttributes(PGUI_CONSOLE_DATA GuiData, - // COORD FontSize, - ULONG FontWeight, - BOOLEAN bItalic, - BOOLEAN bUnderline, - BOOLEAN bStrikeOut) -{ - HFONT NewFont; - LOGFONT lf; - - /* Initialize the LOGFONT structure */ - RtlZeroMemory(&lf, sizeof(lf)); - - /* Retrieve the details of the current font */ - if (GetObject(GuiData->Font, sizeof(lf), &lf) == 0) - return NULL; // GuiData->Font; - - /* Change the font attributes */ - // lf.lfHeight = FontSize.Y; - // lf.lfWidth = FontSize.X; - lf.lfWeight = FontWeight; - lf.lfItalic = bItalic; - lf.lfUnderline = bUnderline; - lf.lfStrikeOut = bStrikeOut; - - /* Build a new font */ - NewFont = CreateFontIndirect(&lf); - if (NewFont == NULL) - return NULL; // GuiData->Font; - - // FIXME: Do we need to update GuiData->CharWidth and GuiData->CharHeight ?? - - /* Select it (return the old font) */ - // return SelectObject(GuiData->hMemDC, NewFont); - return NewFont; } static VOID @@ -309,7 +271,7 @@ * This function supposes that the system clipboard was opened. */ - PCONSOLE Console = Buffer->Header.Console; + PCONSRV_CONSOLE Console = Buffer->Header.Console; HANDLE hData; LPWSTR str; @@ -377,7 +339,7 @@ PRECT rcView, PRECT rcFramebuffer) { - PCONSOLE Console = Buffer->Header.Console; + PCONSRV_CONSOLE Console = Buffer->Header.Console; // ASSERT(Console == GuiData->Console); ULONG TopLine, BottomLine, LeftChar, RightChar; @@ -388,7 +350,7 @@ ULONG CursorX, CursorY, CursorHeight; HBRUSH CursorBrush, OldBrush; HFONT OldFont, NewFont; - BOOLEAN IsUnderscore; + BOOLEAN IsUnderline; if (Buffer->Buffer == NULL) return; @@ -412,17 +374,10 @@ SetTextColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console, TextAttribFromAttrib(LastAttribute))); SetBkColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console, BkgdAttribFromAttrib(LastAttribute))); - // OldFont = ChangeFontAttributes(GuiData, /* {0}, */ GuiData->GuiInfo.FontWeight, FALSE, FALSE, FALSE); - IsUnderscore = !!(LastAttribute & COMMON_LVB_UNDERSCORE); - NewFont = ChangeFontAttributes(GuiData, /* {0}, */ GuiData->GuiInfo.FontWeight, - FALSE, - IsUnderscore, - FALSE); - if (NewFont == NULL) - { - DPRINT1("ChangeFontAttributes failed, use the original font\n"); - NewFont = GuiData->Font; - } + /* We use the underscore flag as a underline flag */ + IsUnderline = !!(LastAttribute & COMMON_LVB_UNDERSCORE); + /* Select the new font */ + NewFont = GuiData->Font[IsUnderline ? FONT_BOLD : FONT_NORMAL]; OldFont = SelectObject(GuiData->hMemDC, NewFont); for (Line = TopLine; Line <= BottomLine; Line++) @@ -454,25 +409,12 @@ SetTextColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console, TextAttribFromAttrib(LastAttribute))); SetBkColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console, BkgdAttribFromAttrib(LastAttribute))); - /* Change underscore state if needed */ - if (!!(LastAttribute & COMMON_LVB_UNDERSCORE) != IsUnderscore) + /* Change underline state if needed */ + if (!!(LastAttribute & COMMON_LVB_UNDERSCORE) != IsUnderline) { - IsUnderscore = !!(LastAttribute & COMMON_LVB_UNDERSCORE); - - /* Delete the font we used up to now */ - // SelectObject(GuiData->hMemDC, OldFont); - if (NewFont != GuiData->Font) DeleteObject(NewFont); - /* Recreate it */ - NewFont = ChangeFontAttributes(GuiData, /* {0}, */ GuiData->GuiInfo.FontWeight, - FALSE, - IsUnderscore, - FALSE); - if (NewFont == NULL) - { - DPRINT1("ChangeFontAttributes failed, use the original font\n"); - NewFont = GuiData->Font; - } - /* Select it */ + IsUnderline = !!(LastAttribute & COMMON_LVB_UNDERSCORE); + /* Select the new font */ + NewFont = GuiData->Font[IsUnderline ? FONT_BOLD : FONT_NORMAL]; /* OldFont = */ SelectObject(GuiData->hMemDC, NewFont); } } @@ -487,6 +429,9 @@ LineBuffer, RightChar - Start + 1); } + + /* Restore the old font */ + SelectObject(GuiData->hMemDC, OldFont); /* * Draw the caret @@ -520,10 +465,6 @@ } } - /* Restore the old font and delete the font we used up to now */ - SelectObject(GuiData->hMemDC, OldFont); - if (NewFont != GuiData->Font) DeleteObject(NewFont); - LeaveCriticalSection(&Console->Lock); } Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/input.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/input.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/input.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -126,7 +126,7 @@ } VOID NTAPI -ConioProcessKey(PCONSOLE Console, MSG* msg) +ConioProcessKey(PCONSRV_CONSOLE Console, MSG* msg) { static BYTE KeyState[256] = { 0 }; /* MSDN mentions that you should use the last virtual key code received @@ -205,7 +205,7 @@ } DWORD -ConioEffectiveCursorSize(PCONSOLE Console, DWORD Scale) +ConioEffectiveCursorSize(PCONSRV_CONSOLE Console, DWORD Scale) { DWORD Size = (Console->ActiveBuffer->CursorInfo.dwSize * Scale + 99) / 100; /* If line input in progress, perhaps adjust for insert toggle */ Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -35,7 +35,7 @@ HWND hWindow; /* Handle to the console's window (used for the window's procedure */ - PCONSOLE Console; /* Pointer to the owned console */ + PCONSRV_CONSOLE Console; /* Pointer to the owned console */ // TUI_CONSOLE_INFO TuiInfo; /* TUI terminal settings */ } TUI_CONSOLE_DATA, *PTUI_CONSOLE_DATA; @@ -261,7 +261,7 @@ { /* PTUI_CONSOLE_DATA TuiData = NULL; - PCONSOLE Console = NULL; + PCONSRV_CONSOLE Console = NULL; TuiData = TuiGetGuiData(hWnd); if (TuiData == NULL) return 0; @@ -330,7 +330,7 @@ TuiConsoleThread(PVOID Data) { PTUI_CONSOLE_DATA TuiData = (PTUI_CONSOLE_DATA)Data; - PCONSOLE Console = TuiData->Console; + PCONSRV_CONSOLE Console = TuiData->Console; HWND NewWindow; MSG msg; @@ -458,11 +458,11 @@ static VOID NTAPI TuiDeinitFrontEnd(IN OUT PFRONTEND This /*, - IN PCONSOLE Console */); - -NTSTATUS NTAPI + IN PCONSRV_CONSOLE Console */); + +static NTSTATUS NTAPI TuiInitFrontEnd(IN OUT PFRONTEND This, - IN PCONSOLE Console) + IN PCONSRV_CONSOLE Console) { PTUI_CONSOLE_DATA TuiData; HANDLE ThreadHandle; @@ -539,7 +539,7 @@ static VOID NTAPI TuiDeinitFrontEnd(IN OUT PFRONTEND This) { - // PCONSOLE Console = This->Console; + // PCONSRV_CONSOLE Console = This->Console; PTUI_CONSOLE_DATA TuiData = This->Data; // Console->FrontEndIFace.Data; /* Close the notification window */ Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.h [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -12,8 +12,8 @@ #pragma once NTSTATUS TuiInitConsole(PCONSOLE Console, - /*IN*/ PCONSOLE_START_INFO ConsoleStartInfo, - PCONSOLE_INFO ConsoleInfo, - DWORD ProcessId); + /*IN*/ PCONSOLE_START_INFO ConsoleStartInfo, + PCONSOLE_INFO ConsoleInfo, + DWORD ProcessId); /* EOF */ Modified: trunk/reactos/win32ss/user/winsrv/consrv/handle.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/handle.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/handle.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -482,7 +482,7 @@ { NTSTATUS Status = STATUS_SUCCESS; HANDLE ConsoleHandle; - PCONSOLE Console; + PCONSRV_CONSOLE Console; /* * We are about to create a new console. However when ConSrvNewProcess Modified: trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -12,20 +12,10 @@ #include "rect.h" -#define CSR_DEFAULT_CURSOR_SIZE 25 - /* Default attributes */ #define DEFAULT_SCREEN_ATTRIB (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED) #define DEFAULT_POPUP_ATTRIB (FOREGROUND_BLUE | FOREGROUND_RED | \ BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY) - -/* VGA character cell */ -typedef struct _CHAR_CELL -{ - CHAR Char; - BYTE Attributes; -} CHAR_CELL, *PCHAR_CELL; -C_ASSERT(sizeof(CHAR_CELL) == 2); /* Object type magic numbers */ @@ -272,7 +262,6 @@ // HACK!! struct _CONSOLE; -struct _WINSRV_CONSOLE; /* HACK: */ typedef struct _CONSOLE *PCONSOLE; #include "conio_winsrv.h" @@ -294,7 +283,7 @@ CONSOLE_INPUT_BUFFER InputBuffer; /* Input buffer of the console */ UINT InputCodePage; - /** Put those things in CONSOLE_INPUT_BUFFER ?? **/ + /** Put those things in CONSOLE_INPUT_BUFFER in PWINSRV_CONSOLE ?? **/ PWCHAR LineBuffer; /* Current line being input, in line buffered mode */ ULONG LineMaxSize; /* Maximum size of line in characters (including CR+LF) */ ULONG LineSize; /* Current size of line */ @@ -303,26 +292,16 @@ BOOLEAN LineUpPressed; BOOLEAN LineInsertToggle; /* Replace character over cursor instead of inserting */ ULONG LineWakeupMask; /* Bitmap of which control characters will end line input */ + + /** In PWINSRV_CONSOLE ?? **/ + BOOLEAN InsertMode; /*************************************************/ - - BOOLEAN InsertMode; /******************************* Screen buffers *******************************/ LIST_ENTRY BufferList; /* List of all screen buffers for this console */ PCONSOLE_SCREEN_BUFFER ActiveBuffer; /* Pointer to currently active screen buffer */ UINT OutputCodePage; - /**** Per-console Virtual DOS Machine Text-mode Buffer ****/ - COORD VDMBufferSize; /* Real size of the VDM buffer, in units of ??? */ - HANDLE VDMBufferSection; /* Handle to the memory shared section for the VDM buffer */ - PVOID VDMBuffer; /* Our VDM buffer */ - PVOID ClientVDMBuffer; /* A copy of the client view of our VDM buffer */ - HANDLE VDMClientProcess; /* Handle to the client process who opened the buffer, to unmap the view */ - - HANDLE StartHardwareEvent; - HANDLE EndHardwareEvent; - HANDLE ErrorHardwareEvent; - /****************************** Other properties ******************************/ UNICODE_STRING OriginalTitle; /* Original title of console, the one defined when the console leader is launched; it never changes. Always NULL-terminated */ UNICODE_STRING Title; /* Title of console. Always NULL-terminated */ @@ -332,11 +311,7 @@ COORD ConsoleSize; /* The current size of the console, for text-mode only */ BOOLEAN FixedSize; /* TRUE if the console is of fixed size */ - COLORREF Colors[16]; /* Colour palette */ - } CONSOLE; // , *PCONSOLE; - -// #include "conio_winsrv.h" /* console.c */ VOID NTAPI @@ -344,18 +319,11 @@ VOID NTAPI ConDrvUnpause(PCONSOLE Console); -PCONSOLE_PROCESS_DATA NTAPI -ConSrvGetConsoleLeaderProcess(IN PCONSOLE Console); NTSTATUS ConSrvConsoleCtrlEvent(IN ULONG CtrlEvent, IN PCONSOLE_PROCESS_DATA ProcessData); -NTSTATUS NTAPI -ConSrvConsoleProcessCtrlEvent(IN PCONSOLE Console, - IN ULONG ProcessGroupId, - IN ULONG CtrlEvent); /* coninput.c */ -VOID NTAPI ConioProcessKey(PCONSOLE Console, MSG* msg); NTSTATUS ConioAddInputEvents(PCONSOLE Console, PINPUT_RECORD InputRecords, @@ -392,7 +360,5 @@ PWCHAR Buffer, DWORD Length, BOOL Attrib); -DWORD ConioEffectiveCursorSize(PCONSOLE Console, - DWORD Scale); /* EOF */ Modified: trunk/reactos/win32ss/user/winsrv/consrv/include/conio_winsrv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/include/conio_winsrv.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/include/conio_winsrv.h [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -12,7 +12,27 @@ #include "rect.h" +// This is ALMOST a HACK!!!!!!! +// Helpers for code refactoring +#define _CONSRV_CONSOLE _CONSOLE +#define CONSRV_CONSOLE CONSOLE +#define PCONSRV_CONSOLE PCONSOLE + +// #define _CONSRV_CONSOLE _WINSRV_CONSOLE +// #define CONSRV_CONSOLE WINSRV_CONSOLE +// #define PCONSRV_CONSOLE PWINSRV_CONSOLE + + #define CSR_DEFAULT_CURSOR_SIZE 25 + +/* VGA character cell */ +typedef struct _CHAR_CELL +{ + CHAR Char; + BYTE Attributes; +} CHAR_CELL, *PCHAR_CELL; +C_ASSERT(sizeof(CHAR_CELL) == 2); + typedef struct _FRONTEND FRONTEND, *PFRONTEND; /* HACK: */ typedef struct _CONSOLE_INFO *PCONSOLE_INFO; @@ -24,7 +44,7 @@ * Internal interface (functions called by the console server only) */ NTSTATUS (NTAPI *InitFrontEnd)(IN OUT PFRONTEND This, - IN struct _CONSOLE* Console); + IN struct _CONSRV_CONSOLE* Console); VOID (NTAPI *DeinitFrontEnd)(IN OUT PFRONTEND This); /* Interface used for both text-mode and graphics screen buffers */ @@ -83,8 +103,7 @@ PFRONTEND_VTBL Vtbl; /* Virtual table */ NTSTATUS (NTAPI *UnloadFrontEnd)(IN OUT PFRONTEND This); - // struct _WINSRV_CONSOLE* - struct _CONSOLE* Console; /* Console to which the frontend is attached to */ + struct _CONSRV_CONSOLE* Console; /* Console to which the frontend is attached to */ PVOID Data; /* Private data */ PVOID OldData; /* Reserved */ }; @@ -99,6 +118,7 @@ /******************************* Console Set-up *******************************/ /* This **MUST** be FIRST!! */ // CONSOLE; + // PCONSOLE Console; // LONG ReferenceCount; /* Is incremented each time a handle to something in the console (a screen-buffer or the input buffer of this console) gets referenced */ // CRITICAL_SECTION Lock; @@ -125,35 +145,49 @@ ULONG NumberOfHistoryBuffers; /* Maximum number of history buffers allowed */ BOOLEAN HistoryNoDup; /* Remove old duplicate history entries */ +/************************ Virtual DOS Machine support *************************/ + COORD VDMBufferSize; /* Real size of the VDM buffer, in units of ??? */ + HANDLE VDMBufferSection; /* Handle to the memory shared section for the VDM buffer */ + PVOID VDMBuffer; /* Our VDM buffer */ + PVOID ClientVDMBuffer; /* A copy of the client view of our VDM buffer */ + HANDLE VDMClientProcess; /* Handle to the client process who opened the buffer, to unmap the view */ + + HANDLE StartHardwareEvent; + HANDLE EndHardwareEvent; + HANDLE ErrorHardwareEvent; + +/****************************** Other properties ******************************/ + COLORREF Colors[16]; /* Colour palette */ + } WINSRV_CONSOLE, *PWINSRV_CONSOLE; /* console.c */ -VOID ConioPause(PCONSOLE Console, UINT Flags); -VOID ConioUnpause(PCONSOLE Console, UINT Flags); +VOID ConioPause(PCONSRV_CONSOLE Console, UINT Flags); +VOID ConioUnpause(PCONSRV_CONSOLE Console, UINT Flags); PCONSOLE_PROCESS_DATA NTAPI -ConSrvGetConsoleLeaderProcess(IN PCONSOLE Console); +ConSrvGetConsoleLeaderProcess(IN PCONSRV_CONSOLE Console); NTSTATUS ConSrvConsoleCtrlEvent(IN ULONG CtrlEvent, IN PCONSOLE_PROCESS_DATA ProcessData); NTSTATUS NTAPI -ConSrvConsoleProcessCtrlEvent(IN PCONSOLE Console, +ConSrvConsoleProcessCtrlEvent(IN PCONSRV_CONSOLE Console, IN ULONG ProcessGroupId, IN ULONG CtrlEvent); /* coninput.c */ -VOID NTAPI ConioProcessKey(PCONSOLE Console, MSG* msg); -DWORD ConioEffectiveCursorSize(PCONSOLE Console, +VOID NTAPI ConioProcessKey(PCONSRV_CONSOLE Console, MSG* msg); +DWORD ConioEffectiveCursorSize(PCONSRV_CONSOLE Console, DWORD Scale); NTSTATUS -ConioAddInputEvents(PCONSOLE Console, +ConioAddInputEvents(PCONSRV_CONSOLE Console, PINPUT_RECORD InputRecords, ULONG NumEventsToWrite, PULONG NumEventsWritten, BOOLEAN AppendToEnd); NTSTATUS -ConioProcessInputEvent(PCONSOLE Console, +ConioProcessInputEvent(PCONSRV_CONSOLE Console, PINPUT_RECORD InputEvent); /* conoutput.c */ @@ -173,11 +207,11 @@ MultiByteToWideChar((Console)->OutputCodePage, 0, (sChar), 1, (dWChar), 1) PCHAR_INFO ConioCoordToPointer(PTEXTMODE_SCREEN_BUFFER Buff, ULONG X, ULONG Y); -VOID ConioDrawConsole(PCONSOLE Console); -NTSTATUS ConioResizeBuffer(PCONSOLE Console, +VOID ConioDrawConsole(PCONSRV_CONSOLE Console); +NTSTATUS ConioResizeBuffer(PCONSRV_CONSOLE Console, PTEXTMODE_SCREEN_BUFFER ScreenBuffer, COORD Size); -NTSTATUS ConioWriteConsole(PCONSOLE Console, +NTSTATUS ConioWriteConsole(PCONSRV_CONSOLE Console, PTEXTMODE_SCREEN_BUFFER Buff, PWCHAR Buffer, DWORD Length, Modified: trunk/reactos/win32ss/user/winsrv/consrv/lineinput.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/lineinput.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/lineinput.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -43,7 +43,7 @@ /* PRIVATE FUNCTIONS **********************************************************/ static PHISTORY_BUFFER -HistoryCurrentBuffer(PCONSOLE Console, +HistoryCurrentBuffer(PCONSRV_CONSOLE Console, PUNICODE_STRING ExeName) { PLIST_ENTRY Entry = Console->HistoryBuffers.Flink; @@ -75,7 +75,7 @@ } static VOID -HistoryAddEntry(PCONSOLE Console, +HistoryAddEntry(PCONSRV_CONSOLE Console, PUNICODE_STRING ExeName) { UNICODE_STRING NewEntry; @@ -127,7 +127,7 @@ } static VOID -HistoryGetCurrentEntry(PCONSOLE Console, +HistoryGetCurrentEntry(PCONSRV_CONSOLE Console, PUNICODE_STRING ExeName, PUNICODE_STRING Entry) { @@ -140,7 +140,7 @@ } static PHISTORY_BUFFER -HistoryFindBuffer(PCONSOLE Console, +HistoryFindBuffer(PCONSRV_CONSOLE Console, PVOID ExeName, USHORT ExeLength, BOOLEAN UnicodeExe) @@ -202,7 +202,7 @@ } VOID -HistoryDeleteBuffers(PCONSOLE Console) +HistoryDeleteBuffers(PCONSRV_CONSOLE Console) { PLIST_ENTRY CurrentEntry; PHISTORY_BUFFER HistoryBuffer; @@ -216,7 +216,7 @@ } static VOID -LineInputSetPos(PCONSOLE Console, UINT Pos) +LineInputSetPos(PCONSRV_CONSOLE Console, UINT Pos) { if (Pos != Console->LinePos && Console->InputBuffer.Mode & ENABLE_ECHO_INPUT) { @@ -240,7 +240,7 @@ } static VOID -LineInputEdit(PCONSOLE Console, UINT NumToDelete, UINT NumToInsert, PWCHAR Insertion) +LineInputEdit(PCONSRV_CONSOLE Console, UINT NumToDelete, UINT NumToInsert, PWCHAR Insertion) { PTEXTMODE_SCREEN_BUFFER ActiveBuffer; UINT Pos = Console->LinePos; @@ -277,7 +277,7 @@ } static VOID -LineInputRecallHistory(PCONSOLE Console, +LineInputRecallHistory(PCONSRV_CONSOLE Console, PUNICODE_STRING ExeName, INT Offset) { @@ -297,7 +297,7 @@ } VOID -LineInputKeyDown(PCONSOLE Console, +LineInputKeyDown(PCONSRV_CONSOLE Console, PUNICODE_STRING ExeName, KEY_EVENT_RECORD *KeyEvent) { @@ -511,7 +511,7 @@ { NTSTATUS Status; PCONSOLE_GETCOMMANDHISTORY GetCommandHistoryRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetCommandHistoryRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; ULONG BytesWritten = 0; PHISTORY_BUFFER Hist; @@ -599,7 +599,7 @@ { NTSTATUS Status; PCONSOLE_GETCOMMANDHISTORYLENGTH GetCommandHistoryLengthRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetCommandHistoryLengthRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; PHISTORY_BUFFER Hist; ULONG Length = 0; UINT i; @@ -641,7 +641,7 @@ { NTSTATUS Status; PCONSOLE_EXPUNGECOMMANDHISTORY ExpungeCommandHistoryRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ExpungeCommandHistoryRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; PHISTORY_BUFFER Hist; if (!CsrValidateMessageBuffer(ApiMessage, @@ -669,7 +669,7 @@ { NTSTATUS Status; PCONSOLE_SETHISTORYNUMBERCOMMANDS SetHistoryNumberCommandsRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetHistoryNumberCommandsRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; PHISTORY_BUFFER Hist; if (!CsrValidateMessageBuffer(ApiMessage, @@ -720,7 +720,7 @@ { #if 0 // Vista+ PCONSOLE_GETSETHISTORYINFO HistoryInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.HistoryInfoRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; NTSTATUS Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); if (NT_SUCCESS(Status)) { @@ -740,7 +740,7 @@ { #if 0 // Vista+ PCONSOLE_GETSETHISTORYINFO HistoryInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.HistoryInfoRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; NTSTATUS Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); if (NT_SUCCESS(Status)) { @@ -760,7 +760,7 @@ { NTSTATUS Status; PCONSOLE_SETHISTORYMODE SetHistoryModeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetHistoryModeRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; DPRINT1("SrvSetConsoleCommandHistoryMode(Mode = %d) is not yet implemented\n", SetHistoryModeRequest->Mode); Modified: trunk/reactos/win32ss/user/winsrv/consrv/lineinput.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/lineinput.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/lineinput.h [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -8,9 +8,9 @@ #pragma once -VOID HistoryDeleteBuffers(PCONSOLE Console); +VOID HistoryDeleteBuffers(PCONSRV_CONSOLE Console); VOID -LineInputKeyDown(PCONSOLE Console, +LineInputKeyDown(PCONSRV_CONSOLE Console, PUNICODE_STRING ExeName, KEY_EVENT_RECORD *KeyEvent); Modified: trunk/reactos/win32ss/user/winsrv/consrv/subsysreg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/subsysreg.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/subsysreg.c [iso-8859-1] Thu Aug 14 20:23:03 2014 @@ -23,7 +23,7 @@ { NTSTATUS Status; PCONSOLE_REGISTERVDM RegisterVDMRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.RegisterVDMRequest; - PCONSOLE Console; + PCONSRV_CONSOLE Console; DPRINT1("SrvRegisterConsoleVDM(%d)\n", RegisterVDMRequest->RegisterFlags);
10 years, 4 months
1
0
0
0
[hbelusca] 63885: [KERNEL32] OpenConsoleW was implemented :P [CONSOLE.CPL][CONSRV] Create all the fonts needed at console startup, and then just select what's needed when fonts attributes need to b...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Thu Aug 14 20:10:00 2014 New Revision: 63885 URL:
http://svn.reactos.org/svn/reactos?rev=63885&view=rev
Log: [KERNEL32] OpenConsoleW was implemented :P [CONSOLE.CPL][CONSRV] Create all the fonts needed at console startup, and then just select what's needed when fonts attributes need to be changed at run-time. [CONSOLE.CPL][CONSRV] - HACKFIX: Temporary use FW_NORMAL instead of FW_DONTCARE as default font weight (in ReactOS, FW_DONTCARE makes fonts bold by default, instead of normal) - Use bold fonts instead of the underlined ones for underlined fonts in the terminal. Timo, FIX THE FONTS !!!!!!!!!! :P CORE-8439 #comment Should be fixed in revision 63885. Modified: branches/condrv_restructure/dll/cpl/console/console.c branches/condrv_restructure/dll/cpl/console/layout.c branches/condrv_restructure/dll/win32/kernel32/client/console/console.c branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/text.c Modified: branches/condrv_restructure/dll/cpl/console/console.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/dll/cpl/cons…
============================================================================== --- branches/condrv_restructure/dll/cpl/console/console.c [iso-8859-1] (original) +++ branches/condrv_restructure/dll/cpl/console/console.c [iso-8859-1] Thu Aug 14 20:10:00 2014 @@ -117,7 +117,8 @@ GuiInfo->FontFamily = FF_DONTCARE; GuiInfo->FontSize.X = 0; GuiInfo->FontSize.Y = 0; - GuiInfo->FontWeight = FW_DONTCARE; + GuiInfo->FontWeight = FW_NORMAL; // HACK: !! + // GuiInfo->FontWeight = FW_DONTCARE; GuiInfo->FullScreen = FALSE; GuiInfo->ShowWindow = SW_SHOWNORMAL; Modified: branches/condrv_restructure/dll/cpl/console/layout.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/dll/cpl/cons…
============================================================================== --- branches/condrv_restructure/dll/cpl/console/layout.c [iso-8859-1] (original) +++ branches/condrv_restructure/dll/cpl/console/layout.c [iso-8859-1] Thu Aug 14 20:10:00 2014 @@ -121,7 +121,7 @@ if (!hBrush) return FALSE; Font = CreateFontW(GuiInfo->FontSize.Y, - 0, // GuiInfo->FontSize.X, + GuiInfo->FontSize.X, 0, TA_BASELINE, GuiInfo->FontWeight, @@ -131,8 +131,8 @@ OEM_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, - NONANTIALIASED_QUALITY, - FIXED_PITCH | GuiInfo->FontFamily /* FF_DONTCARE */, + DEFAULT_QUALITY, // NONANTIALIASED_QUALITY ; ANTIALIASED_QUALITY + FIXED_PITCH | GuiInfo->FontFamily, GuiInfo->FaceName); if (Font == NULL) { Modified: branches/condrv_restructure/dll/win32/kernel32/client/console/console.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/dll/win32/ke…
============================================================================== --- branches/condrv_restructure/dll/win32/kernel32/client/console/console.c [iso-8859-1] (original) +++ branches/condrv_restructure/dll/win32/kernel32/client/console/console.c [iso-8859-1] Thu Aug 14 20:10:00 2014 @@ -561,7 +561,7 @@ /* - * @unimplemented (Undocumented) + * @implemented (Undocumented) */ HANDLE WINAPI Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] Thu Aug 14 20:10:00 2014 @@ -486,15 +486,166 @@ // to: InvalidateRect(GuiData->hWindow, NULL, TRUE); } + +VOID +DeleteFonts(PGUI_CONSOLE_DATA GuiData) +{ + ULONG i; + for (i = 0; i < sizeof(GuiData->Font) / sizeof(GuiData->Font[0]); ++i) + { + if (GuiData->Font[i] != NULL) DeleteObject(GuiData->Font[i]); + GuiData->Font[i] = NULL; + } +} + +static HFONT +CreateDerivedFont(HFONT OrgFont, + // COORD FontSize, + ULONG FontWeight, + // BOOLEAN bItalic, + BOOLEAN bUnderline, + BOOLEAN bStrikeOut) +{ + LOGFONT lf; + + /* Initialize the LOGFONT structure */ + RtlZeroMemory(&lf, sizeof(lf)); + + /* Retrieve the details of the current font */ + if (GetObject(OrgFont, sizeof(lf), &lf) == 0) + return NULL; + + /* Change the font attributes */ + // lf.lfHeight = FontSize.Y; + // lf.lfWidth = FontSize.X; + lf.lfWeight = FontWeight; + // lf.lfItalic = bItalic; + lf.lfUnderline = bUnderline; + lf.lfStrikeOut = bStrikeOut; + + /* Build a new font */ + return CreateFontIndirect(&lf); +} + +BOOL +InitFonts(PGUI_CONSOLE_DATA GuiData, + LPWSTR FaceName, // Points to a WCHAR array of LF_FACESIZE elements. + ULONG FontFamily, + COORD FontSize, + ULONG FontWeight) +{ + HDC hDC; + HFONT OldFont, NewFont; + TEXTMETRICW Metrics; + SIZE CharSize; + + /* + * Initialize a new NORMAL font and get its metrics. + */ + + NewFont = CreateFontW(FontSize.Y, + FontSize.X, + 0, + TA_BASELINE, + FontWeight, + FALSE, + FALSE, + FALSE, + OEM_CHARSET, + OUT_DEFAULT_PRECIS, + CLIP_DEFAULT_PRECIS, + DEFAULT_QUALITY, // NONANTIALIASED_QUALITY ; ANTIALIASED_QUALITY + FIXED_PITCH | FontFamily, + FaceName); + if (NewFont == NULL) + { + DPRINT1("InitFonts: CreateFontW failed\n"); + return FALSE; + } + + hDC = GetDC(GuiData->hWindow); + if (hDC == NULL) + { + DPRINT1("InitFonts: GetDC failed\n"); + DeleteObject(NewFont); + return FALSE; + } + + OldFont = SelectObject(hDC, NewFont); + if (OldFont == NULL) + { + DPRINT1("InitFonts: SelectObject failed\n"); + ReleaseDC(GuiData->hWindow, hDC); + DeleteObject(NewFont); + return FALSE; + } + + if (!GetTextMetricsW(hDC, &Metrics)) + { + DPRINT1("InitFonts: GetTextMetrics failed\n"); + SelectObject(hDC, OldFont); + ReleaseDC(GuiData->hWindow, hDC); + DeleteObject(NewFont); + return FALSE; + } + GuiData->CharWidth = Metrics.tmMaxCharWidth; + GuiData->CharHeight = Metrics.tmHeight + Metrics.tmExternalLeading; + + /* Measure real char width more precisely if possible. */ + if (GetTextExtentPoint32W(hDC, L"R", 1, &CharSize)) + GuiData->CharWidth = CharSize.cx; + + SelectObject(hDC, OldFont); + ReleaseDC(GuiData->hWindow, hDC); + + /* + * Initialization succeeded. + */ + // Delete all the old fonts first. + DeleteFonts(GuiData); + GuiData->Font[FONT_NORMAL] = NewFont; + + /* + * Now build the other fonts (bold, underlined, mixed). + */ + GuiData->Font[FONT_BOLD] = + CreateDerivedFont(GuiData->Font[FONT_NORMAL], + FontWeight < FW_BOLD ? FW_BOLD : FontWeight, + FALSE, + FALSE); + GuiData->Font[FONT_UNDERLINE] = + CreateDerivedFont(GuiData->Font[FONT_NORMAL], + FontWeight, + TRUE, + FALSE); + GuiData->Font[FONT_BOLD | FONT_UNDERLINE] = + CreateDerivedFont(GuiData->Font[FONT_NORMAL], + FontWeight < FW_BOLD ? FW_BOLD : FontWeight, + TRUE, + FALSE); + + /* + * Save the settings. + */ + if (FaceName != GuiData->GuiInfo.FaceName) + { + SIZE_T Length = min(wcslen(FaceName) + 1, LF_FACESIZE); // wcsnlen + wcsncpy(GuiData->GuiInfo.FaceName, FaceName, LF_FACESIZE); + GuiData->GuiInfo.FaceName[Length] = L'\0'; // NULL-terminate + } + GuiData->GuiInfo.FontFamily = FontFamily; + GuiData->GuiInfo.FontSize = FontSize; + GuiData->GuiInfo.FontWeight = FontWeight; + + return TRUE; +} + + static BOOL OnNcCreate(HWND hWnd, LPCREATESTRUCTW Create) { PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA)Create->lpCreateParams; PCONSRV_CONSOLE Console; - HDC hDC; - HFONT OldFont; - TEXTMETRICW Metrics; - SIZE CharSize; if (NULL == GuiData) { @@ -506,67 +657,18 @@ GuiData->hWindow = hWnd; - GuiData->Font = CreateFontW(GuiData->GuiInfo.FontSize.Y, - 0, // GuiData->GuiInfo.FontSize.X, - 0, - TA_BASELINE, - GuiData->GuiInfo.FontWeight, - FALSE, - FALSE, - FALSE, - OEM_CHARSET, - OUT_DEFAULT_PRECIS, - CLIP_DEFAULT_PRECIS, - NONANTIALIASED_QUALITY, - FIXED_PITCH | GuiData->GuiInfo.FontFamily /* FF_DONTCARE */, - GuiData->GuiInfo.FaceName); - - if (NULL == GuiData->Font) - { - DPRINT1("GuiConsoleNcCreate: CreateFont failed\n"); + /* Initialize the fonts */ + if (!InitFonts(GuiData, + GuiData->GuiInfo.FaceName, + GuiData->GuiInfo.FontFamily, + GuiData->GuiInfo.FontSize, + GuiData->GuiInfo.FontWeight)) + { + DPRINT1("GuiConsoleNcCreate: InitFonts failed\n"); GuiData->hWindow = NULL; SetEvent(GuiData->hGuiInitEvent); return FALSE; } - hDC = GetDC(GuiData->hWindow); - if (NULL == hDC) - { - DPRINT1("GuiConsoleNcCreate: GetDC failed\n"); - DeleteObject(GuiData->Font); - GuiData->hWindow = NULL; - SetEvent(GuiData->hGuiInitEvent); - return FALSE; - } - OldFont = SelectObject(hDC, GuiData->Font); - if (NULL == OldFont) - { - DPRINT1("GuiConsoleNcCreate: SelectObject failed\n"); - ReleaseDC(GuiData->hWindow, hDC); - DeleteObject(GuiData->Font); - GuiData->hWindow = NULL; - SetEvent(GuiData->hGuiInitEvent); - return FALSE; - } - if (!GetTextMetricsW(hDC, &Metrics)) - { - DPRINT1("GuiConsoleNcCreate: GetTextMetrics failed\n"); - SelectObject(hDC, OldFont); - ReleaseDC(GuiData->hWindow, hDC); - DeleteObject(GuiData->Font); - GuiData->hWindow = NULL; - SetEvent(GuiData->hGuiInitEvent); - return FALSE; - } - GuiData->CharWidth = Metrics.tmMaxCharWidth; - GuiData->CharHeight = Metrics.tmHeight + Metrics.tmExternalLeading; - - /* Measure real char width more precisely if possible. */ - if (GetTextExtentPoint32W(hDC, L"R", 1, &CharSize)) - GuiData->CharWidth = CharSize.cx; - - SelectObject(hDC, OldFont); - - ReleaseDC(GuiData->hWindow, hDC); /* Initialize the terminal framebuffer */ GuiData->hMemDC = CreateCompatibleDC(NULL); @@ -1341,7 +1443,7 @@ if (GuiData->hMemDC ) DeleteDC(GuiData->hMemDC); if (GuiData->hBitmap) DeleteObject(GuiData->hBitmap); // if (GuiData->hSysPalette) DeleteObject(GuiData->hSysPalette); - if (GuiData->Font) DeleteObject(GuiData->Font); + DeleteFonts(GuiData); } /* Free the GuiData registration */ Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h [iso-8859-1] Thu Aug 14 20:10:00 2014 @@ -21,6 +21,17 @@ #define PM_CONSOLE_BEEP (WM_APP + 4) #define PM_CONSOLE_SET_TITLE (WM_APP + 5) +/* +typedef struct _CONSOLE_FONT +{ + HFONT Font; + ULONG Flag; +} CONSOLE_FONT, *PCONSOLE_FONT; +*/ +#define FONT_NORMAL 0x00 +#define FONT_BOLD 0x01 +#define FONT_UNDERLINE 0x02 +#define FONT_MAXNO 0x04 typedef struct _GUI_CONSOLE_DATA { @@ -56,9 +67,9 @@ // PVOID ScreenBuffer; /* Hardware screen buffer */ - HFONT Font; - UINT CharWidth; - UINT CharHeight; + HFONT Font[FONT_MAXNO]; + UINT CharWidth; /* The character width and height should be the same for */ + UINT CharHeight; /* both normal and bold/underlined fonts... */ /*****************************************************/ PCONSRV_CONSOLE Console; /* Pointer to the owned console */ Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c [iso-8859-1] Thu Aug 14 20:10:00 2014 @@ -16,9 +16,6 @@ #include "guiterm.h" #include "guisettings.h" - -VOID GuiConsoleMoveWindow(PGUI_CONSOLE_DATA GuiData); -VOID SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen); /* FUNCTIONS ******************************************************************/ @@ -199,14 +196,14 @@ // wcsncpy(TermInfo->FaceName, L"DejaVu Sans Mono", LF_FACESIZE); // TermInfo->FontSize = MAKELONG(8, 12); // 0x000C0008; // font is 8x12 // TermInfo->FontSize = MAKELONG(16, 16); // font is 16x16 - // TermInfo->FontWeight = FW_NORMAL; wcsncpy(TermInfo->FaceName, L"VGA", LF_FACESIZE); // HACK: !! // TermInfo->FaceName[0] = L'\0'; TermInfo->FontFamily = FF_DONTCARE; TermInfo->FontSize.X = 0; TermInfo->FontSize.Y = 0; - TermInfo->FontWeight = FW_DONTCARE; + TermInfo->FontWeight = FW_NORMAL; // HACK: !! + // TermInfo->FontWeight = FW_DONTCARE; TermInfo->FullScreen = FALSE; TermInfo->ShowWindow = SW_SHOWNORMAL; @@ -418,92 +415,6 @@ return; } - - - -BOOL -ChangeFont(PGUI_CONSOLE_DATA GuiData, - LPWSTR FaceName, // Points to a WCHAR array of LF_FACESIZE elements. - ULONG FontFamily, - COORD FontSize, - ULONG FontWeight) -{ - HDC hDC; - HFONT OldFont, NewFont; - TEXTMETRICW Metrics; - SIZE CharSize; - SIZE_T Length; - - NewFont = CreateFontW(FontSize.Y, - 0, // FontSize.X, - 0, - TA_BASELINE, - FontWeight, - FALSE, - FALSE, - FALSE, - OEM_CHARSET, - OUT_DEFAULT_PRECIS, - CLIP_DEFAULT_PRECIS, - NONANTIALIASED_QUALITY, - FIXED_PITCH | FontFamily /* FF_DONTCARE */, - FaceName); - if (NewFont == NULL) - { - DPRINT1("ChangeFont: CreateFont failed\n"); - return FALSE; - } - - hDC = GetDC(GuiData->hWindow); - if (hDC == NULL) - { - DPRINT1("ChangeFont: GetDC failed\n"); - DeleteObject(NewFont); - return FALSE; - } - - OldFont = SelectObject(hDC, NewFont); - if (OldFont == NULL) - { - DPRINT1("ChangeFont: SelectObject failed\n"); - ReleaseDC(GuiData->hWindow, hDC); - DeleteObject(NewFont); - return FALSE; - } - - if (!GetTextMetricsW(hDC, &Metrics)) - { - DPRINT1("ChangeFont: GetTextMetrics failed\n"); - SelectObject(hDC, OldFont); - ReleaseDC(GuiData->hWindow, hDC); - DeleteObject(NewFont); - return FALSE; - } - GuiData->CharWidth = Metrics.tmMaxCharWidth; - GuiData->CharHeight = Metrics.tmHeight + Metrics.tmExternalLeading; - - /* Measure real char width more precisely if possible. */ - if (GetTextExtentPoint32W(hDC, L"R", 1, &CharSize)) - GuiData->CharWidth = CharSize.cx; - - SelectObject(hDC, OldFont); - ReleaseDC(GuiData->hWindow, hDC); - - if (GuiData->Font != NULL) DeleteObject(GuiData->Font); - GuiData->Font = NewFont; - - Length = min(wcslen(FaceName) + 1, LF_FACESIZE); // wcsnlen - wcsncpy(GuiData->GuiInfo.FaceName, FaceName, LF_FACESIZE); - GuiData->GuiInfo.FaceName[Length] = L'\0'; // NULL-terminate - GuiData->GuiInfo.FontFamily = FontFamily; - GuiData->GuiInfo.FontSize = FontSize; - GuiData->GuiInfo.FontWeight = FontWeight; - - return TRUE; -} - - - VOID GuiApplyUserSettings(PGUI_CONSOLE_DATA GuiData, HANDLE hClientSection, @@ -586,11 +497,11 @@ // memcpy(&GuiData->GuiInfo, GuiInfo, sizeof(GUI_CONSOLE_INFO)); /* Change the font */ - ChangeFont(GuiData, - GuiInfo->FaceName, - GuiInfo->FontFamily, - GuiInfo->FontSize, - GuiInfo->FontWeight); + InitFonts(GuiData, + GuiInfo->FaceName, + GuiInfo->FontFamily, + GuiInfo->FontSize, + GuiInfo->FontWeight); // HACK, needed because changing font may change the size of the window /**/TermResizeTerminal(Console);/**/ @@ -768,11 +679,11 @@ // memcpy(&GuiData->GuiInfo, &GuiInfo, sizeof(GUI_CONSOLE_INFO)); /* Change the font */ - ChangeFont(GuiData, - GuiInfo.FaceName, - GuiInfo.FontFamily, - GuiInfo.FontSize, - GuiInfo.FontWeight); + InitFonts(GuiData, + GuiInfo.FaceName, + GuiInfo.FontFamily, + GuiInfo.FontSize, + GuiInfo.FontWeight); // HACK, needed because changing font may change the size of the window /**/TermResizeTerminal(Console);/**/ Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h [iso-8859-1] Thu Aug 14 20:10:00 2014 @@ -29,7 +29,6 @@ typedef struct _GUI_CONSOLE_INFO { - // FONTSIGNATURE FontSignature; WCHAR FaceName[LF_FACESIZE]; ULONG FontFamily; COORD FontSize; Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h [iso-8859-1] Thu Aug 14 20:10:00 2014 @@ -20,3 +20,18 @@ DWORD ProcessId, LPCWSTR IconPath, INT IconIndex); + +VOID +GuiConsoleMoveWindow(PGUI_CONSOLE_DATA GuiData); + +VOID +SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen); + +BOOL +InitFonts(PGUI_CONSOLE_DATA GuiData, + LPWSTR FaceName, // Points to a WCHAR array of LF_FACESIZE elements. + ULONG FontFamily, + COORD FontSize, + ULONG FontWeight); +VOID +DeleteFonts(PGUI_CONSOLE_DATA GuiData); Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/text.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] Thu Aug 14 20:10:00 2014 @@ -34,44 +34,6 @@ GetPaletteEntries(hPalette, Attribute, 1, &pe); return PALETTERGB(pe.peRed, pe.peGreen, pe.peBlue); -} - -static HFONT -ChangeFontAttributes(PGUI_CONSOLE_DATA GuiData, - // COORD FontSize, - ULONG FontWeight, - BOOLEAN bItalic, - BOOLEAN bUnderline, - BOOLEAN bStrikeOut) -{ - HFONT NewFont; - LOGFONT lf; - - /* Initialize the LOGFONT structure */ - RtlZeroMemory(&lf, sizeof(lf)); - - /* Retrieve the details of the current font */ - if (GetObject(GuiData->Font, sizeof(lf), &lf) == 0) - return NULL; // GuiData->Font; - - /* Change the font attributes */ - // lf.lfHeight = FontSize.Y; - // lf.lfWidth = FontSize.X; - lf.lfWeight = FontWeight; - lf.lfItalic = bItalic; - lf.lfUnderline = bUnderline; - lf.lfStrikeOut = bStrikeOut; - - /* Build a new font */ - NewFont = CreateFontIndirect(&lf); - if (NewFont == NULL) - return NULL; // GuiData->Font; - - // FIXME: Do we need to update GuiData->CharWidth and GuiData->CharHeight ?? - - /* Select it (return the old font) */ - // return SelectObject(GuiData->hMemDC, NewFont); - return NewFont; } static VOID @@ -388,7 +350,7 @@ ULONG CursorX, CursorY, CursorHeight; HBRUSH CursorBrush, OldBrush; HFONT OldFont, NewFont; - BOOLEAN IsUnderscore; + BOOLEAN IsUnderline; if (Buffer->Buffer == NULL) return; @@ -412,17 +374,10 @@ SetTextColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console, TextAttribFromAttrib(LastAttribute))); SetBkColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console, BkgdAttribFromAttrib(LastAttribute))); - // OldFont = ChangeFontAttributes(GuiData, /* {0}, */ GuiData->GuiInfo.FontWeight, FALSE, FALSE, FALSE); - IsUnderscore = !!(LastAttribute & COMMON_LVB_UNDERSCORE); - NewFont = ChangeFontAttributes(GuiData, /* {0}, */ GuiData->GuiInfo.FontWeight, - FALSE, - IsUnderscore, - FALSE); - if (NewFont == NULL) - { - DPRINT1("ChangeFontAttributes failed, use the original font\n"); - NewFont = GuiData->Font; - } + /* We use the underscore flag as a underline flag */ + IsUnderline = !!(LastAttribute & COMMON_LVB_UNDERSCORE); + /* Select the new font */ + NewFont = GuiData->Font[IsUnderline ? FONT_BOLD : FONT_NORMAL]; OldFont = SelectObject(GuiData->hMemDC, NewFont); for (Line = TopLine; Line <= BottomLine; Line++) @@ -454,25 +409,12 @@ SetTextColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console, TextAttribFromAttrib(LastAttribute))); SetBkColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console, BkgdAttribFromAttrib(LastAttribute))); - /* Change underscore state if needed */ - if (!!(LastAttribute & COMMON_LVB_UNDERSCORE) != IsUnderscore) + /* Change underline state if needed */ + if (!!(LastAttribute & COMMON_LVB_UNDERSCORE) != IsUnderline) { - IsUnderscore = !!(LastAttribute & COMMON_LVB_UNDERSCORE); - - /* Delete the font we used up to now */ - // SelectObject(GuiData->hMemDC, OldFont); - if (NewFont != GuiData->Font) DeleteObject(NewFont); - /* Recreate it */ - NewFont = ChangeFontAttributes(GuiData, /* {0}, */ GuiData->GuiInfo.FontWeight, - FALSE, - IsUnderscore, - FALSE); - if (NewFont == NULL) - { - DPRINT1("ChangeFontAttributes failed, use the original font\n"); - NewFont = GuiData->Font; - } - /* Select it */ + IsUnderline = !!(LastAttribute & COMMON_LVB_UNDERSCORE); + /* Select the new font */ + NewFont = GuiData->Font[IsUnderline ? FONT_BOLD : FONT_NORMAL]; /* OldFont = */ SelectObject(GuiData->hMemDC, NewFont); } } @@ -487,6 +429,9 @@ LineBuffer, RightChar - Start + 1); } + + /* Restore the old font */ + SelectObject(GuiData->hMemDC, OldFont); /* * Draw the caret @@ -520,10 +465,6 @@ } } - /* Restore the old font and delete the font we used up to now */ - SelectObject(GuiData->hMemDC, OldFont); - if (NewFont != GuiData->Font) DeleteObject(NewFont); - LeaveCriticalSection(&Console->Lock); }
10 years, 4 months
1
0
0
0
[tfaber] 63884: [SHELL32] - Correctly manage object lifetime in CDefaultContextMenu. Members of DEFCONTEXTMENU need to be referenced or cloned in order to keep them. CORE-8430 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Aug 14 19:47:45 2014 New Revision: 63884 URL:
http://svn.reactos.org/svn/reactos?rev=63884&view=rev
Log: [SHELL32] - Correctly manage object lifetime in CDefaultContextMenu. Members of DEFCONTEXTMENU need to be referenced or cloned in order to keep them. CORE-8430 #resolve Modified: trunk/reactos/dll/win32/shell32/defcontextmenu.cpp Modified: trunk/reactos/dll/win32/shell32/defcontextmenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/defconte…
============================================================================== --- trunk/reactos/dll/win32/shell32/defcontextmenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/defcontextmenu.cpp [iso-8859-1] Thu Aug 14 19:47:45 2014 @@ -37,9 +37,11 @@ public IContextMenu2 { private: - DEFCONTEXTMENU m_Dcm; + IShellFolder *m_psf; + UINT m_cidl; + PCUITEMID_CHILD_ARRAY m_apidl; IDataObject *m_pDataObj; - LPCITEMIDLIST m_pidlFolder; + PIDLIST_ABSOLUTE m_pidlFolder; DWORD m_bGroupPolicyActive; PDynamicShellEntry m_pDynamicEntries; /* first dynamic shell extension entry */ UINT m_iIdSHEFirst; /* first used id */ @@ -92,18 +94,20 @@ END_COM_MAP() }; -CDefaultContextMenu::CDefaultContextMenu() -{ - memset(&m_Dcm, 0, sizeof(m_Dcm)); - m_pDataObj = NULL; - m_pidlFolder = NULL; - m_bGroupPolicyActive = 0; - m_pDynamicEntries = NULL; - m_iIdSHEFirst = 0; - m_iIdSHELast = 0; - m_pStaticEntries = NULL; - m_iIdSCMFirst = 0; - m_iIdSCMLast = 0; +CDefaultContextMenu::CDefaultContextMenu() : + m_psf(NULL), + m_cidl(0), + m_apidl(NULL), + m_pDataObj(NULL), + m_pidlFolder(NULL), + m_bGroupPolicyActive(0), + m_pDynamicEntries(NULL), + m_iIdSHEFirst(0), + m_iIdSHELast(0), + m_pStaticEntries(NULL), + m_iIdSCMFirst(0), + m_iIdSCMLast(0) +{ } CDefaultContextMenu::~CDefaultContextMenu() @@ -130,9 +134,12 @@ } if (m_pidlFolder) - ILFree((_ITEMIDLIST*)m_pidlFolder); + CoTaskMemFree(m_pidlFolder); if (m_pDataObj) m_pDataObj->Release(); + _ILFreeaPidl(const_cast<PITEMID_CHILD *>(m_apidl), m_cidl); + if (m_psf) + m_psf->Release(); } HRESULT WINAPI CDefaultContextMenu::Initialize(const DEFCONTEXTMENU *pdcm) @@ -140,28 +147,33 @@ IDataObject *pDataObj; TRACE("cidl %u\n", pdcm->cidl); + + m_cidl = pdcm->cidl; + m_apidl = const_cast<PCUITEMID_CHILD_ARRAY>(_ILCopyaPidl(pdcm->apidl, m_cidl)); + if (!m_apidl) + return E_OUTOFMEMORY; + m_psf = pdcm->psf; + m_psf->AddRef(); + if (SUCCEEDED(SHCreateDataObject(pdcm->pidlFolder, pdcm->cidl, pdcm->apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj)))) m_pDataObj = pDataObj; - if (!pdcm->cidl) - { - /* Init pidlFolder only if it is background context menu. See IShellExtInit::Initialize */ - if (pdcm->pidlFolder) - m_pidlFolder = ILClone(pdcm->pidlFolder); - else - { - IPersistFolder2 *pf = NULL; - if (SUCCEEDED(pdcm->psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &pf)))) - { - if (FAILED(pf->GetCurFolder((_ITEMIDLIST**)&m_pidlFolder))) - ERR("GetCurFolder failed\n"); - pf->Release(); - } + if (pdcm->pidlFolder) + { + m_pidlFolder = ILClone(pdcm->pidlFolder); + } + else + { + IPersistFolder2 *pf = NULL; + if (SUCCEEDED(m_psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &pf)))) + { + if (FAILED(pf->GetCurFolder(reinterpret_cast<LPITEMIDLIST*>(&m_pidlFolder)))) + ERR("GetCurFolder failed\n"); + pf->Release(); } TRACE("pidlFolder %p\n", m_pidlFolder); } - CopyMemory(&m_Dcm, pdcm, sizeof(DEFCONTEXTMENU)); return S_OK; } @@ -603,7 +615,7 @@ /* set first entry as default */ if (pEntry == m_pStaticEntries) fState |= MFS_DEFAULT; - + if (!wcsicmp(pEntry->szVerb, L"open")) { /* override default when open verb is found */ @@ -714,14 +726,14 @@ HRESULT hr; TRACE("BuildShellItemContextMenu entered\n"); - ASSERT(m_Dcm.cidl >= 1); + ASSERT(m_cidl >= 1); STRRET strFile; - hr = m_Dcm.psf->GetDisplayNameOf(m_Dcm.apidl[0], SHGDN_FORPARSING, &strFile); + hr = m_psf->GetDisplayNameOf(m_apidl[0], SHGDN_FORPARSING, &strFile); if (hr == S_OK) { WCHAR wszPath[MAX_PATH]; - hr = StrRetToBufW(&strFile, m_Dcm.apidl[0], wszPath, _countof(wszPath)); + hr = StrRetToBufW(&strFile, m_apidl[0], wszPath, _countof(wszPath)); if (hr == S_OK) { LPCWSTR pwszExt = PathFindExtensionW(wszPath); @@ -765,7 +777,7 @@ else ERR("GetDisplayNameOf failed: %x\n", hr); - GUID *pGuid = _ILGetGUIDPointer(m_Dcm.apidl[0]); + GUID *pGuid = _ILGetGUIDPointer(m_apidl[0]); if (pGuid) { LPOLESTR pwszCLSID; @@ -787,7 +799,7 @@ } } - if (_ILIsDrive(m_Dcm.apidl[0])) + if (_ILIsDrive(m_apidl[0])) { AddStaticEntryForFileClass(L"Drive"); if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"Drive", 0, KEY_READ, &hKey) == ERROR_SUCCESS) @@ -800,7 +812,7 @@ /* add static actions */ SFGAOF rfg = SFGAO_BROWSABLE | SFGAO_CANCOPY | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANDELETE | SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_FILESYSTEM | SFGAO_FOLDER; - hr = m_Dcm.psf->GetAttributesOf(m_Dcm.cidl, m_Dcm.apidl, &rfg); + hr = m_psf->GetAttributesOf(m_cidl, m_apidl, &rfg); if (FAILED(hr)) { ERR("GetAttributesOf failed: %x\n", hr); @@ -818,7 +830,7 @@ } /* Directory is only loaded for real filesystem directories */ - if (_ILIsFolder(m_Dcm.apidl[0])) + if (_ILIsFolder(m_apidl[0])) { AddStaticEntryForFileClass(L"Directory"); if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"Directory", 0, KEY_READ, &hKey) == ERROR_SUCCESS) @@ -830,7 +842,7 @@ } /* AllFilesystemObjects class is loaded only for files and directories */ - if (_ILIsFolder(m_Dcm.apidl[0]) || _ILIsValue(m_Dcm.apidl[0])) + if (_ILIsFolder(m_apidl[0]) || _ILIsValue(m_apidl[0])) { if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"AllFilesystemObjects", 0, KEY_READ, &hKey) == ERROR_SUCCESS) { @@ -848,7 +860,7 @@ IndexMenu = InsertMenuItemsOfDynamicContextMenuExtension(hMenu, IndexMenu, iIdCmdFirst, iIdCmdLast); TRACE("IndexMenu %d\n", IndexMenu); - if (_ILIsDrive(m_Dcm.apidl[0])) + if (_ILIsDrive(m_apidl[0])) { /* The 'Format' option must be always available, * thus it is not registered as a static shell extension */ @@ -916,7 +928,7 @@ UINT idCmdLast, UINT uFlags) { - if (m_Dcm.cidl) + if (m_cidl) idCmdFirst = BuildShellItemContextMenu(hMenu, idCmdFirst, idCmdLast, uFlags); else idCmdFirst = BuildBackgroundContextMenu(hMenu, idCmdFirst, idCmdLast, uFlags); @@ -951,7 +963,7 @@ { CComPtr<IPersistFolder2> ppf2 = NULL; LPITEMIDLIST pidl; - HRESULT hr = m_Dcm.psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &ppf2)); + HRESULT hr = m_psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &ppf2)); if (SUCCEEDED(hr)) { hr = ppf2->GetCurFolder(&pidl); @@ -984,9 +996,9 @@ return hr; /* Find target folder */ - if (m_Dcm.cidl) - { - hr = m_Dcm.psf->BindToObject(m_Dcm.apidl[0], NULL, IID_PPV_ARG(IShellFolder, &psfTarget)); + if (m_cidl) + { + hr = m_psf->BindToObject(m_apidl[0], NULL, IID_PPV_ARG(IShellFolder, &psfTarget)); } else { @@ -994,7 +1006,7 @@ LPITEMIDLIST pidl; /* cidl is zero due to explorer view */ - hr = m_Dcm.psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &ppf2)); + hr = m_psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &ppf2)); if (SUCCEEDED(hr)) { hr = ppf2->GetCurFolder(&pidl); @@ -1087,9 +1099,9 @@ if (FAILED(hr)) return hr; - if (SUCCEEDED(hr = SHCreateDataObject(m_Dcm.pidlFolder, m_Dcm.cidl, m_Dcm.apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj)))) - { - hr = m_Dcm.psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &ppf2)); + if (SUCCEEDED(hr = SHCreateDataObject(m_pidlFolder, m_cidl, m_apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj)))) + { + hr = m_psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &ppf2)); if (SUCCEEDED(hr)) { hr = ppf2->GetCurFolder(&pidl); @@ -1134,13 +1146,13 @@ LPDATAOBJECT pDataObj; - if (SUCCEEDED(SHCreateDataObject(m_Dcm.pidlFolder, m_Dcm.cidl, m_Dcm.apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj)))) + if (SUCCEEDED(SHCreateDataObject(m_pidlFolder, m_cidl, m_apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj)))) { pDataObj->AddRef(); SHCreateThread(DoDeleteThreadProc, pDataObj, NULL, NULL); pDataObj->Release(); - } - else + } + else return E_FAIL; return S_OK; @@ -1154,7 +1166,7 @@ LPDATAOBJECT pDataObj; HRESULT hr; - if (SUCCEEDED(SHCreateDataObject(m_Dcm.pidlFolder, m_Dcm.cidl, m_Dcm.apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj)))) + if (SUCCEEDED(SHCreateDataObject(m_pidlFolder, m_cidl, m_apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj)))) { if (!bCopy) { @@ -1233,7 +1245,7 @@ return hr; } - lpSV->SelectItem(m_Dcm.apidl[0], + lpSV->SelectItem(m_apidl[0], SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE | SVSI_FOCUSED | SVSI_SELECT); lpSV->Release(); return S_OK; @@ -1244,26 +1256,26 @@ LPCMINVOKECOMMANDINFO lpcmi) { HRESULT hr = S_OK; - const ITEMIDLIST *pidlParent = m_Dcm.pidlFolder, *pidlChild; + const ITEMIDLIST *pidlParent = m_pidlFolder, *pidlChild; if (!pidlParent) { IPersistFolder2 *pf; /* pidlFolder is optional */ - if (SUCCEEDED(m_Dcm.psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &pf)))) + if (SUCCEEDED(m_psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &pf)))) { pf->GetCurFolder((_ITEMIDLIST**)&pidlParent); pf->Release(); } } - if (m_Dcm.cidl > 0) - pidlChild = m_Dcm.apidl[0]; + if (m_cidl > 0) + pidlChild = m_apidl[0]; else { /* Set pidlChild to last pidl of current folder */ - if (pidlParent == m_Dcm.pidlFolder) + if (pidlParent == m_pidlFolder) pidlParent = (ITEMIDLIST*)ILClone(pidlParent); pidlChild = (ITEMIDLIST*)ILClone(ILFindLastID(pidlParent)); @@ -1303,11 +1315,11 @@ } else { - if (m_Dcm.cidl > 1) + if (m_cidl > 1) WARN("SHMultiFileProperties is not yet implemented\n"); STRRET strFile; - hr = m_Dcm.psf->GetDisplayNameOf(pidlChild, SHGDN_FORPARSING, &strFile); + hr = m_psf->GetDisplayNameOf(pidlChild, SHGDN_FORPARSING, &strFile); if (SUCCEEDED(hr)) { WCHAR wszBuf[MAX_PATH]; @@ -1322,9 +1334,9 @@ } /* Free allocated PIDLs */ - if (pidlParent != m_Dcm.pidlFolder) + if (pidlParent != m_pidlFolder) ILFree((ITEMIDLIST*)pidlParent); - if (m_Dcm.cidl < 1 || pidlChild != m_Dcm.apidl[0]) + if (m_cidl < 1 || pidlChild != m_apidl[0]) ILFree((ITEMIDLIST*)pidlChild); return hr; @@ -1336,7 +1348,7 @@ { char szDrive[8] = {0}; - if (!_ILGetDrive(m_Dcm.apidl[0], szDrive, sizeof(szDrive))) + if (!_ILGetDrive(m_apidl[0], szDrive, sizeof(szDrive))) { ERR("pidl is not a drive\n"); return E_FAIL; @@ -1417,7 +1429,7 @@ if (lpSB == NULL) return E_FAIL; - hr = lpSB->BrowseObject(ILCombine(m_Dcm.pidlFolder, pidl), wFlags); + hr = lpSB->BrowseObject(ILCombine(m_pidlFolder, pidl), wFlags); return hr; } @@ -1425,7 +1437,7 @@ HRESULT CDefaultContextMenu::InvokePidl(LPCMINVOKECOMMANDINFO lpcmi, LPCITEMIDLIST pidl, PStaticShellEntry pEntry) { - LPITEMIDLIST pidlFull = ILCombine(m_Dcm.pidlFolder, pidl); + LPITEMIDLIST pidlFull = ILCombine(m_pidlFolder, pidl); if (pidlFull == NULL) { return E_FAIL; @@ -1442,7 +1454,7 @@ } else { - SHGetPathFromIDListW(m_Dcm.pidlFolder, wszDir); + SHGetPathFromIDListW(m_pidlFolder, wszDir); } HKEY hkeyClass; @@ -1491,7 +1503,7 @@ DWORD wFlags = BrowserFlagsFromVerb(lpcmi, pEntry); BOOL bBrowsed = FALSE; - for (i=0; i < m_Dcm.cidl; i++) + for (i=0; i < m_cidl; i++) { /* Check if we need to browse */ if (wFlags > 0) @@ -1502,7 +1514,7 @@ if (bBrowsed) continue; - hr = TryToBrowse(lpcmi, m_Dcm.apidl[i], wFlags); + hr = TryToBrowse(lpcmi, m_apidl[i], wFlags); if (SUCCEEDED(hr)) { bBrowsed = TRUE; @@ -1510,7 +1522,7 @@ } } - InvokePidl(lpcmi, m_Dcm.apidl[i], pEntry); + InvokePidl(lpcmi, m_apidl[i], pEntry); } return S_OK;
10 years, 4 months
1
0
0
0
[tfaber] 63883: [NPFS] - Fix list walk in NpCancelWaiter -- we cannot access the list entry after using RemoveEntryList on it - Make the logic in NpCancelWaiter more readable CORE-8442 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Aug 14 19:35:00 2014 New Revision: 63883 URL:
http://svn.reactos.org/svn/reactos?rev=63883&view=rev
Log: [NPFS] - Fix list walk in NpCancelWaiter -- we cannot access the list entry after using RemoveEntryList on it - Make the logic in NpCancelWaiter more readable CORE-8442 #resolve Modified: trunk/reactos/drivers/filesystems/npfs/waitsup.c Modified: trunk/reactos/drivers/filesystems/npfs/waitsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/w…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/waitsup.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/waitsup.c [iso-8859-1] Thu Aug 14 19:35:00 2014 @@ -26,11 +26,11 @@ IoReleaseCancelSpinLock(Irp->CancelIrql); - WaitQueue = (PNP_WAIT_QUEUE)Irp->Tail.Overlay.DriverContext[0]; + WaitQueue = Irp->Tail.Overlay.DriverContext[0]; KeAcquireSpinLock(&WaitQueue->WaitLock, &OldIrql); - WaitEntry = (PNP_WAIT_QUEUE_ENTRY)Irp->Tail.Overlay.DriverContext[1]; + WaitEntry = Irp->Tail.Overlay.DriverContext[1]; if (WaitEntry) { RemoveEntryList(&Irp->Tail.Overlay.ListEntry); @@ -102,94 +102,91 @@ NTSTATUS NTAPI NpCancelWaiter(IN PNP_WAIT_QUEUE WaitQueue, - IN PUNICODE_STRING PipeName, + IN PUNICODE_STRING PipePath, IN NTSTATUS Status, IN PLIST_ENTRY List) { - UNICODE_STRING DestinationString; + UNICODE_STRING PipePathUpper; KIRQL OldIrql; PWCHAR Buffer; PLIST_ENTRY NextEntry; PNP_WAIT_QUEUE_ENTRY WaitEntry, Linkage; PIRP WaitIrp; PFILE_PIPE_WAIT_FOR_BUFFER WaitBuffer; - ULONG i, NameLength; + UNICODE_STRING WaitName, PipeName; Linkage = NULL; Buffer = ExAllocatePoolWithTag(NonPagedPool, - PipeName->Length, + PipePath->Length, NPFS_WAIT_BLOCK_TAG); if (!Buffer) return STATUS_INSUFFICIENT_RESOURCES; - RtlInitEmptyUnicodeString(&DestinationString, Buffer, PipeName->Length); - RtlUpcaseUnicodeString(&DestinationString, PipeName, FALSE); + RtlInitEmptyUnicodeString(&PipePathUpper, Buffer, PipePath->Length); + RtlUpcaseUnicodeString(&PipePathUpper, PipePath, FALSE); KeAcquireSpinLock(&WaitQueue->WaitLock, &OldIrql); - for (NextEntry = WaitQueue->WaitList.Flink; - NextEntry != &WaitQueue->WaitList; - NextEntry = NextEntry->Flink) + NextEntry = WaitQueue->WaitList.Flink; + while (NextEntry != &WaitQueue->WaitList) { WaitIrp = CONTAINING_RECORD(NextEntry, IRP, Tail.Overlay.ListEntry); + NextEntry = NextEntry->Flink; WaitEntry = WaitIrp->Tail.Overlay.DriverContext[1]; if (WaitEntry->AliasName.Length) { ASSERT(FALSE); - if (DestinationString.Length == WaitEntry->AliasName.Length) - { - if (RtlCompareMemory(WaitEntry->AliasName.Buffer, - DestinationString.Buffer, - DestinationString.Length) == - DestinationString.Length) - { -CancelWait: - RemoveEntryList(&WaitIrp->Tail.Overlay.ListEntry); - if (KeCancelTimer(&WaitEntry->Timer)) - { - WaitEntry->WaitQueue = (PNP_WAIT_QUEUE)Linkage; - Linkage = WaitEntry; - } - else - { - WaitEntry->Irp = NULL; - WaitIrp->Tail.Overlay.DriverContext[1] = NULL; - } - - if (IoSetCancelRoutine(WaitIrp, NULL)) - { - WaitIrp->IoStatus.Information = 0; - WaitIrp->IoStatus.Status = Status; - InsertTailList(List, &WaitIrp->Tail.Overlay.ListEntry); - } - else - { - WaitIrp->Tail.Overlay.DriverContext[1] = NULL; - } - } - } + /* We have an alias. Use that for comparison */ + WaitName = WaitEntry->AliasName; + PipeName = PipePathUpper; } else { + /* Use the name from the wait buffer to compare */ WaitBuffer = WaitIrp->AssociatedIrp.SystemBuffer; - - if (WaitBuffer->NameLength + sizeof(WCHAR) == DestinationString.Length) - { - NameLength = WaitBuffer->NameLength / sizeof(WCHAR); - for (i = 0; i < NameLength; i++) - { - if (WaitBuffer->Name[i] != DestinationString.Buffer[i + 1]) break; - } - - if (i >= NameLength) goto CancelWait; + WaitName.Buffer = WaitBuffer->Name; + WaitName.Length = WaitBuffer->NameLength; + WaitName.MaximumLength = WaitName.Length; + + /* WaitName doesn't have a leading backslash, + * so skip the one in PipePathUpper for the comparison */ + PipeName.Buffer = PipePathUpper.Buffer + 1; + PipeName.Length = PipePathUpper.Length - sizeof(WCHAR); + PipeName.MaximumLength = PipeName.Length; + } + + if (RtlEqualUnicodeString(&WaitName, &PipeName, FALSE)) + { + /* Found a matching wait. Cancel it */ + RemoveEntryList(&WaitIrp->Tail.Overlay.ListEntry); + if (KeCancelTimer(&WaitEntry->Timer)) + { + WaitEntry->WaitQueue = (PNP_WAIT_QUEUE)Linkage; + Linkage = WaitEntry; + } + else + { + WaitEntry->Irp = NULL; + WaitIrp->Tail.Overlay.DriverContext[1] = NULL; + } + + if (IoSetCancelRoutine(WaitIrp, NULL)) + { + WaitIrp->IoStatus.Information = 0; + WaitIrp->IoStatus.Status = Status; + InsertTailList(List, &WaitIrp->Tail.Overlay.ListEntry); + } + else + { + WaitIrp->Tail.Overlay.DriverContext[1] = NULL; } } } KeReleaseSpinLock(&WaitQueue->WaitLock, OldIrql); - ExFreePool(DestinationString.Buffer); + ExFreePoolWithTag(Buffer, NPFS_WAIT_BLOCK_TAG); while (Linkage) {
10 years, 4 months
1
0
0
0
[tfaber] 63882: [SHELL32] - Use correct prototype for IFolderView::SelectAndPositionItems in CDefView
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Aug 14 13:26:02 2014 New Revision: 63882 URL:
http://svn.reactos.org/svn/reactos?rev=63882&view=rev
Log: [SHELL32] - Use correct prototype for IFolderView::SelectAndPositionItems in CDefView Modified: trunk/reactos/dll/win32/shell32/shlview.cpp Modified: trunk/reactos/dll/win32/shell32/shlview.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlview.…
============================================================================== --- trunk/reactos/dll/win32/shell32/shlview.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shlview.cpp [iso-8859-1] Thu Aug 14 13:26:02 2014 @@ -164,7 +164,7 @@ virtual HRESULT STDMETHODCALLTYPE GetDefaultSpacing(POINT *ppt); virtual HRESULT STDMETHODCALLTYPE GetAutoArrange(); virtual HRESULT STDMETHODCALLTYPE SelectItem(int iItem, DWORD dwFlags); - virtual HRESULT STDMETHODCALLTYPE SelectAndPositionItems(UINT cidl, LPCITEMIDLIST *apidl, POINT *apt, DWORD dwFlags); + virtual HRESULT STDMETHODCALLTYPE SelectAndPositionItems(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, POINT *apt, DWORD dwFlags); // *** IOleCommandTarget methods *** virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT *pCmdText); @@ -2309,7 +2309,7 @@ return S_OK; } -HRESULT STDMETHODCALLTYPE CDefView::SelectAndPositionItems(UINT cidl, LPCITEMIDLIST *apidl, POINT *apt, DWORD dwFlags) +HRESULT STDMETHODCALLTYPE CDefView::SelectAndPositionItems(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, POINT *apt, DWORD dwFlags) { return E_NOTIMPL; }
10 years, 4 months
1
0
0
0
[tfaber] 63881: [PSDK] - Fix some ITEMIDLIST types in IShellFolder CORE-8441
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Aug 14 13:21:32 2014 New Revision: 63881 URL:
http://svn.reactos.org/svn/reactos?rev=63881&view=rev
Log: [PSDK] - Fix some ITEMIDLIST types in IShellFolder CORE-8441 Modified: trunk/reactos/include/psdk/shobjidl.idl Modified: trunk/reactos/include/psdk/shobjidl.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shobjidl.idl?…
============================================================================== --- trunk/reactos/include/psdk/shobjidl.idl [iso-8859-1] (original) +++ trunk/reactos/include/psdk/shobjidl.idl [iso-8859-1] Thu Aug 14 13:21:32 2014 @@ -224,21 +224,21 @@ [out] IEnumIDList **ppenumIDList); HRESULT BindToObject( - [in] LPCITEMIDLIST pidl, + [in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut); HRESULT BindToStorage( - [in] LPCITEMIDLIST pidl, + [in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvObj); HRESULT CompareIDs( [in] LPARAM lParam, - [in] LPCITEMIDLIST pidl1, - [in] LPCITEMIDLIST pidl2); + [in] PCUIDLIST_RELATIVE pidl1, + [in] PCUIDLIST_RELATIVE pidl2); HRESULT CreateViewObject( [in] HWND hwndOwner, @@ -247,28 +247,28 @@ HRESULT GetAttributesOf( [in] UINT cidl, - [in, size_is(cidl)] LPCITEMIDLIST *apidl, + [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in, out] SFGAOF *rgfInOut); HRESULT GetUIObjectOf( [in] HWND hwndOwner, [in] UINT cidl, - [in, size_is(cidl)] LPCITEMIDLIST *apidl, + [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in] REFIID riid, [in, out, unique] UINT *prgfInOut, [out, iid_is(riid)] void **ppvOut); HRESULT GetDisplayNameOf( - [in] LPCITEMIDLIST pidl, + [in] PCUITEMID_CHILD pidl, [in] SHGDNF uFlags, [out] STRRET *lpName); HRESULT SetNameOf( [in] HWND hwnd, - [in] LPCITEMIDLIST pidl, + [in] PCUITEMID_CHILD pidl, [in, string] LPCOLESTR lpszName, [in] SHGDNF uFlags, - [out] LPITEMIDLIST *ppidlOut); + [out] PITEMID_CHILD *ppidlOut); }
10 years, 4 months
1
0
0
0
[tfaber] 63880: [WIN32K:NTUSER] - Assert that the thread's sent message queue matches change bits in UserDbgAssertThreadInfo. Suggested by Giannis. CORE-7013
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Aug 14 07:46:59 2014 New Revision: 63880 URL:
http://svn.reactos.org/svn/reactos?rev=63880&view=rev
Log: [WIN32K:NTUSER] - Assert that the thread's sent message queue matches change bits in UserDbgAssertThreadInfo. Suggested by Giannis. CORE-7013 Modified: trunk/reactos/win32ss/user/ntuser/misc.c Modified: trunk/reactos/win32ss/user/ntuser/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/misc.c…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/misc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/misc.c [iso-8859-1] Thu Aug 14 07:46:59 2014 @@ -656,6 +656,8 @@ ASSERT(pci->ulClientDelta == DesktopHeapGetUserDelta()); if (pti->pcti && pci->pDeskInfo) ASSERT(pci->pClientThreadInfo == (PVOID)((ULONG_PTR)pti->pcti - pci->ulClientDelta)); + if (pti->pcti && IsListEmpty(&pti->SentMessagesListHead)) + ASSERT((pti->pcti->fsChangeBits & QS_SENDMESSAGE) == 0); if (pti->KeyboardLayout) ASSERT(pci->hKL == pti->KeyboardLayout->hkl); if(pti->rpdesk != NULL)
10 years, 4 months
1
0
0
0
[dquintana] 63879: Sync with trunk r63878.
by dquintana@svn.reactos.org
Author: dquintana Date: Wed Aug 13 18:16:14 2014 New Revision: 63879 URL:
http://svn.reactos.org/svn/reactos?rev=63879&view=rev
Log: Sync with trunk r63878. Modified: branches/shell-experiments/ (props changed) branches/shell-experiments/base/applications/notepad/lang/sq-AL.rc branches/shell-experiments/base/setup/usetup/cabinet.c branches/shell-experiments/base/shell/explorer/explorer-sq.rc branches/shell-experiments/boot/bootdata/packages/CMakeLists.txt branches/shell-experiments/cmake/CMakeMacros.cmake branches/shell-experiments/dll/cpl/console/console.c branches/shell-experiments/dll/cpl/console/font.c branches/shell-experiments/dll/cpl/console/lang/bg-BG.rc branches/shell-experiments/dll/cpl/console/lang/cs-CZ.rc branches/shell-experiments/dll/cpl/console/lang/de-DE.rc branches/shell-experiments/dll/cpl/console/lang/en-US.rc branches/shell-experiments/dll/cpl/console/lang/es-ES.rc branches/shell-experiments/dll/cpl/console/lang/fr-FR.rc branches/shell-experiments/dll/cpl/console/lang/he-IL.rc branches/shell-experiments/dll/cpl/console/lang/id-ID.rc branches/shell-experiments/dll/cpl/console/lang/it-IT.rc branches/shell-experiments/dll/cpl/console/lang/no-NO.rc branches/shell-experiments/dll/cpl/console/lang/pl-PL.rc branches/shell-experiments/dll/cpl/console/lang/ro-RO.rc branches/shell-experiments/dll/cpl/console/lang/ru-RU.rc branches/shell-experiments/dll/cpl/console/lang/sk-SK.rc branches/shell-experiments/dll/cpl/console/lang/sq-AL.rc branches/shell-experiments/dll/cpl/console/lang/tr-TR.rc branches/shell-experiments/dll/cpl/console/lang/uk-UA.rc branches/shell-experiments/dll/cpl/console/lang/zh-CN.rc branches/shell-experiments/dll/cpl/console/layout.c branches/shell-experiments/dll/cpl/desk/lang/sq-AL.rc branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp branches/shell-experiments/dll/win32/kernel32/client/console/readwrite.c branches/shell-experiments/dll/win32/kernel32/client/dosdev.c branches/shell-experiments/dll/win32/kernel32/client/vdm.c branches/shell-experiments/dll/win32/rpcrt4/ndr_marshall.c branches/shell-experiments/dll/win32/serialui/lang/sq-AL.rc branches/shell-experiments/dll/win32/shell32/folders/fs.cpp branches/shell-experiments/dll/win32/shell32/folders/fs.h branches/shell-experiments/dll/win32/shell32/lang/sq-AL.rc branches/shell-experiments/dll/win32/syssetup/security.c branches/shell-experiments/include/psdk/wincon.h branches/shell-experiments/include/reactos/subsys/win/conmsg.h branches/shell-experiments/subsystems/ntvdm/hardware/vga.c branches/shell-experiments/tools/cdmake/dirhash.c branches/shell-experiments/tools/spec2def/spec2def.c branches/shell-experiments/win32ss/user/ntuser/focus.c branches/shell-experiments/win32ss/user/winsrv/consrv/condrv/conoutput.c branches/shell-experiments/win32ss/user/winsrv/consrv/condrv/text.c branches/shell-experiments/win32ss/user/winsrv/consrv/conoutput.c branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/text.c branches/shell-experiments/win32ss/user/winsrv/consrv/handle.c branches/shell-experiments/win32ss/user/winsrv/consrv/handle.h branches/shell-experiments/win32ss/user/winsrv/consrv/include/conio.h branches/shell-experiments/win32ss/user/winsrv/consrv/include/conio_winsrv.h branches/shell-experiments/win32ss/user/winsrv/consrv/include/settings.h branches/shell-experiments/win32ss/user/winsrv/consrv/procinit.h branches/shell-experiments/win32ss/user/winsrv/consrv/subsysreg.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/shell-experiments/base/applications/notepad/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicat…
Modified: branches/shell-experiments/base/setup/usetup/cabinet.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/setup/us…
Modified: branches/shell-experiments/base/shell/explorer/explorer-sq.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/ex…
Modified: branches/shell-experiments/boot/bootdata/packages/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/boot/bootdata…
Modified: branches/shell-experiments/cmake/CMakeMacros.cmake URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/cmake/CMakeMa…
Modified: branches/shell-experiments/dll/cpl/console/console.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/font.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/he-IL.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/id-ID.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/console/layout.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/conso…
Modified: branches/shell-experiments/dll/cpl/desk/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/desk/…
Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
Modified: branches/shell-experiments/dll/win32/kernel32/client/console/readwrite.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/ker…
Modified: branches/shell-experiments/dll/win32/kernel32/client/dosdev.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/ker…
Modified: branches/shell-experiments/dll/win32/kernel32/client/vdm.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/ker…
Modified: branches/shell-experiments/dll/win32/rpcrt4/ndr_marshall.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/rpc…
Modified: branches/shell-experiments/dll/win32/serialui/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/ser…
Modified: branches/shell-experiments/dll/win32/shell32/folders/fs.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
Modified: branches/shell-experiments/dll/win32/shell32/folders/fs.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
Modified: branches/shell-experiments/dll/win32/shell32/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
Modified: branches/shell-experiments/dll/win32/syssetup/security.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/sys…
Modified: branches/shell-experiments/include/psdk/wincon.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/include/psdk/…
Modified: branches/shell-experiments/include/reactos/subsys/win/conmsg.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/include/react…
Modified: branches/shell-experiments/subsystems/ntvdm/hardware/vga.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/subsystems/nt…
Modified: branches/shell-experiments/tools/cdmake/dirhash.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/tools/cdmake/…
Modified: branches/shell-experiments/tools/spec2def/spec2def.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/tools/spec2de…
Modified: branches/shell-experiments/win32ss/user/ntuser/focus.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/condrv/conoutput.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/condrv/text.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/conoutput.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/text.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/handle.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/handle.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/include/conio.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/include/conio_winsrv.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/include/settings.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/procinit.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/subsysreg.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
10 years, 4 months
1
0
0
0
[jgardou] 63878: [CMAKE] - Properly serve reactos.cab dependencies - try 2 CORE-8435 #comment this should do it, please retest. Regarding the bot problem, touching boot/bootdata/packages/reactos.df...
by jgardou@svn.reactos.org
Author: jgardou Date: Wed Aug 13 16:30:52 2014 New Revision: 63878 URL:
http://svn.reactos.org/svn/reactos?rev=63878&view=rev
Log: [CMAKE] - Properly serve reactos.cab dependencies - try 2 CORE-8435 #comment this should do it, please retest. Regarding the bot problem, touching boot/bootdata/packages/reactos.dff forces regenerating reactos.inf and reactos.cab Modified: trunk/reactos/boot/bootdata/packages/CMakeLists.txt trunk/reactos/cmake/CMakeMacros.cmake Modified: trunk/reactos/boot/bootdata/packages/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/CMa…
============================================================================== --- trunk/reactos/boot/bootdata/packages/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/CMakeLists.txt [iso-8859-1] Wed Aug 13 16:30:52 2014 @@ -31,24 +31,18 @@ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.dyn ) -# And now we build reactos.cab - -# First we create reactos.inf +# And now we build reactos.inf add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf COMMAND native-cabman -C ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff -L ${CMAKE_CURRENT_BINARY_DIR} -I -P ${REACTOS_SOURCE_DIR} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff native-cabman) -# Then we create the actual cab file using a custom target -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab - COMMAND native-cabman -C ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff -RC ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf -L ${CMAKE_CURRENT_BINARY_DIR} -N -P ${REACTOS_SOURCE_DIR} - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf native-cabman) - -add_custom_target(reactos_cab DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab) +# reactos.cab generation will be made later (cf. CMakeMacros.cmake - create iso lists) +add_custom_target(reactos_cab_inf DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf) add_cd_file( TARGET reactos_cab - FILE ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf + FILE ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf DESTINATION reactos NO_CAB FOR bootcd regtest) + Modified: trunk/reactos/cmake/CMakeMacros.cmake URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/CMakeMacros.cmake?re…
============================================================================== --- trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] Wed Aug 13 16:30:52 2014 @@ -316,15 +316,11 @@ file(APPEND ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff.dyn "\"${__relative_file}\" ${_num}\n") unset(__relative_file) if(_CD_TARGET) - #manage dependency - add_dependencies(reactos_cab ${_CD_TARGET}) - # add this so that the combination make target/fast reactos_cab/fast bootcd/fast properly detects that reactos.cab must be rebuilt - if (CMAKE_BUILD_TOOL STREQUAL "make") - add_custom_command(TARGET ${_CD_TARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E touch ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff) - endif() + #manage dependency - target level + add_dependencies(reactos_cab_inf ${_CD_TARGET}) endif() + # manage dependency - file level + set_property(GLOBAL APPEND PROPERTY REACTOS_CAB_DEPENDS ${_CD_FILE}) endif() endif() #end bootcd @@ -378,6 +374,22 @@ endfunction() function(create_iso_lists) + # generate reactos.cab before anything else + get_property(_filelist GLOBAL PROPERTY REACTOS_CAB_DEPENDS) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab + COMMAND native-cabman -C ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff -RC ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.inf -N -P ${REACTOS_SOURCE_DIR} + DEPENDS ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.inf native-cabman ${_filelist}) + + add_custom_target(reactos_cab DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab) + add_dependencies(reactos_cab reactos_cab_inf) + + add_cd_file( + TARGET reactos_cab + FILE ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab + DESTINATION reactos + NO_CAB FOR bootcd regtest) + get_property(_filelist GLOBAL PROPERTY BOOTCD_FILE_LIST) string(REPLACE ";" "\n" _filelist "${_filelist}") file(APPEND ${REACTOS_BINARY_DIR}/boot/bootcd.lst "${_filelist}")
10 years, 4 months
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
23
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Results per page:
10
25
50
100
200