ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
April 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
15 participants
492 discussions
Start a n
N
ew thread
[hbelusca] 62687: [NTVDM] - Just define GetNextVDMCommand and ExitVDM at their correct places. - Code cleaning.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Apr 8 14:35:35 2014 New Revision: 62687 URL:
http://svn.reactos.org/svn/reactos?rev=62687&view=rev
Log: [NTVDM] - Just define GetNextVDMCommand and ExitVDM at their correct places. - Code cleaning. Modified: branches/ntvdm/dll/win32/kernel32/include/vdm.h branches/ntvdm/include/reactos/subsys/win/vdm.h branches/ntvdm/subsystems/ntvdm/CMakeLists.txt branches/ntvdm/subsystems/ntvdm/ntvdm.h Modified: branches/ntvdm/dll/win32/kernel32/include/vdm.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/dll/win32/kernel32/includ…
============================================================================== --- branches/ntvdm/dll/win32/kernel32/include/vdm.h [iso-8859-1] (original) +++ branches/ntvdm/dll/win32/kernel32/include/vdm.h [iso-8859-1] Tue Apr 8 14:35:35 2014 @@ -66,17 +66,4 @@ IN HANDLE hUserToken OPTIONAL ); -BOOL -WINAPI -GetNextVDMCommand( - IN OUT PVDM_COMMAND_INFO CommandData OPTIONAL -); - -VOID -WINAPI -ExitVDM( - IN BOOL IsWow, - IN ULONG iWowTask -); - /* EOF */ Modified: branches/ntvdm/include/reactos/subsys/win/vdm.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/include/reactos/subsys/wi…
============================================================================== --- branches/ntvdm/include/reactos/subsys/win/vdm.h [iso-8859-1] (original) +++ branches/ntvdm/include/reactos/subsys/win/vdm.h [iso-8859-1] Tue Apr 8 14:35:35 2014 @@ -12,7 +12,7 @@ #pragma once -/* CONSTANTS ******************************************************************/ +/* CONSTANTS & TYPES **********************************************************/ typedef enum _VDM_ENTRY_CODE { @@ -85,6 +85,22 @@ BOOLEAN ComingFromBat; } VDM_COMMAND_INFO, *PVDM_COMMAND_INFO; + +/* FUNCTION PROTOTYPES ********************************************************/ + +BOOL +WINAPI +GetNextVDMCommand( + IN OUT PVDM_COMMAND_INFO CommandData OPTIONAL +); + +VOID +WINAPI +ExitVDM( + IN BOOL IsWow, + IN ULONG iWowTask +); + #endif // _VDM_H /* EOF */ Modified: branches/ntvdm/subsystems/ntvdm/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/CMakeLis…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] Tue Apr 8 14:35:35 2014 @@ -36,7 +36,7 @@ add_executable(ntvdm ${SOURCE}) set_module_type(ntvdm win32cui UNICODE) +set_image_base(ntvdm 0x0F000000) target_link_libraries(ntvdm fast486) add_importlibs(ntvdm user32 gdi32 advapi32 msvcrt kernel32 ntdll) add_cd_file(TARGET ntvdm DESTINATION reactos/system32 FOR all) -set_image_base(ntvdm 0x0F000000) Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.h?…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ntvdm.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ntvdm.h [iso-8859-1] Tue Apr 8 14:35:35 2014 @@ -29,21 +29,6 @@ #include <debug.h> -/* PROTOTYPES *****************************************************************/ - -BOOL -WINAPI -GetNextVDMCommand( - IN OUT PVDM_COMMAND_INFO CommandData OPTIONAL -); - -VOID -WINAPI -ExitVDM( - IN BOOL IsWow, - IN ULONG iWowTask -); - /* FUNCTIONS ******************************************************************/ VOID DisplayMessage(LPCWSTR Format, ...);
10 years, 8 months
1
0
0
0
[aandrejevic] 62686: [NTVDM] Start implementing the BaseVDM interface.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Tue Apr 8 00:28:49 2014 New Revision: 62686 URL:
http://svn.reactos.org/svn/reactos?rev=62686&view=rev
Log: [NTVDM] Start implementing the BaseVDM interface. Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.c branches/ntvdm/subsystems/ntvdm/ntvdm.h Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.c?…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] Tue Apr 8 00:28:49 2014 @@ -371,9 +371,14 @@ INT wmain(INT argc, WCHAR *argv[]) { #ifndef STANDALONE - wprintf(L"\nReactOS Virtual DOS Machine\n\n" - L"OS integration (BaseVDM) unimplemented\n"); - return 0; + + VDM_COMMAND_INFO CommandInfo; + CHAR CmdLine[MAX_PATH]; + CHAR AppName[MAX_PATH]; + CHAR PifFile[MAX_PATH]; + CHAR Desktop[MAX_PATH]; + CHAR Title[MAX_PATH]; + #else CHAR CommandLine[DOS_CMDLINE_LENGTH]; @@ -391,6 +396,8 @@ DPRINT1("\n\n\nNTVDM - Starting '%s'...\n\n\n", CommandLine); +#endif + /* Initialize the console */ if (!ConsoleInit()) { @@ -419,6 +426,44 @@ goto Cleanup; } +#ifndef STANDALONE + + while (TRUE) + { + /* Clear the structure */ + ZeroMemory(&CommandInfo, sizeof(CommandInfo)); + + /* Initialize the structure members */ + CommandInfo.VDMState = VDM_NOT_LOADED; + CommandInfo.CmdLine = CmdLine; + CommandInfo.CmdLen = sizeof(CmdLine); + CommandInfo.AppName = AppName; + CommandInfo.AppLen = sizeof(AppName); + CommandInfo.PifFile = PifFile; + CommandInfo.PifLen = sizeof(PifFile); + CommandInfo.Desktop = Desktop; + CommandInfo.DesktopLen = sizeof(Desktop); + CommandInfo.Title = Title; + CommandInfo.TitleLen = sizeof(Title); + + if (!GetNextVDMCommand(&CommandInfo)) break; + + /* Start the process from the command line */ + if (!DosCreateProcess(AppName, 0)) + { + DisplayMessage(L"Could not start program: %S", AppName); + goto Cleanup; + } + + /* Start simulation */ + EmulatorSimulate(); + + /* Perform another screen refresh */ + VgaRefreshDisplay(); + } + +#else + /* Start the process from the command line */ if (!DosCreateProcess(CommandLine, 0)) { @@ -428,6 +473,8 @@ /* Start simulation */ EmulatorSimulate(); + +#endif /* Perform another screen refresh */ VgaRefreshDisplay(); @@ -437,11 +484,11 @@ EmulatorCleanup(); ConsoleCleanup(); + /* Quit the VDM */ DPRINT1("\n\n\nNTVDM - Exiting...\n\n\n"); + ExitVDM(FALSE, 0); return 0; - -#endif } /* EOF */ Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.h?…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ntvdm.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ntvdm.h [iso-8859-1] Tue Apr 8 00:28:49 2014 @@ -23,12 +23,26 @@ #include <winnls.h> #include <winreg.h> #include <winuser.h> +#include <subsys/win/vdm.h> #include <vddsvc.h> #include <debug.h> -/* DEFINES ********************************************************************/ +/* PROTOTYPES *****************************************************************/ + +BOOL +WINAPI +GetNextVDMCommand( + IN OUT PVDM_COMMAND_INFO CommandData OPTIONAL +); + +VOID +WINAPI +ExitVDM( + IN BOOL IsWow, + IN ULONG iWowTask +); /* FUNCTIONS ******************************************************************/
10 years, 8 months
1
0
0
0
[khornicek] 62685: [INTL] - fix a leak - fix a buffer overrun CID #503741 CID #716119
by khornicek@svn.reactos.org
Author: khornicek Date: Tue Apr 8 00:14:44 2014 New Revision: 62685 URL:
http://svn.reactos.org/svn/reactos?rev=62685&view=rev
Log: [INTL] - fix a leak - fix a buffer overrun CID #503741 CID #716119 Modified: trunk/reactos/dll/cpl/intl/date.c trunk/reactos/dll/cpl/intl/sort.c Modified: trunk/reactos/dll/cpl/intl/date.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/date.c?rev=62…
============================================================================== --- trunk/reactos/dll/cpl/intl/date.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/intl/date.c [iso-8859-1] Tue Apr 8 00:14:44 2014 @@ -57,6 +57,9 @@ pszFoundSep = (LPTSTR)malloc(MAX_SAMPLES_STR_SIZE * sizeof(TCHAR)); + if(!pszFoundSep) + return NULL; + _tcscpy(pszFoundSep,STD_DATE_SEP); while (nDateCompCount < _tcslen(szSourceStr)) @@ -121,8 +124,9 @@ { TCHAR szShortDateFmt[MAX_SAMPLES_STR_SIZE]; TCHAR szShortDateSep[MAX_SAMPLES_STR_SIZE]; - TCHAR szFindedDateSep[MAX_SAMPLES_STR_SIZE]; + TCHAR szFoundDateSep[MAX_SAMPLES_STR_SIZE]; LPTSTR pszResultStr; + LPTSTR pszFoundSep; BOOL OpenApostFlg = FALSE; INT nFmtStrSize; INT nDateCompCount; @@ -166,11 +170,16 @@ return FALSE; } + pszFoundSep = FindDateSep(szShortDateFmt); + /* Substring replacement of separator */ - _tcscpy(szFindedDateSep, FindDateSep(szShortDateFmt)); - pszResultStr = ReplaceSubStr(szShortDateFmt, szShortDateSep, szFindedDateSep); + _tcscpy(szFoundDateSep, pszFoundSep); + pszResultStr = ReplaceSubStr(szShortDateFmt, szShortDateSep, szFoundDateSep); _tcscpy(szShortDateFmt, pszResultStr); free(pszResultStr); + + if(pszFoundSep) + free(pszFoundSep); /* Save short date format */ SetLocaleInfo(lcid, LOCALE_SSHORTDATE, szShortDateFmt); Modified: trunk/reactos/dll/cpl/intl/sort.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/sort.c?rev=62…
============================================================================== --- trunk/reactos/dll/cpl/intl/sort.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/intl/sort.c [iso-8859-1] Tue Apr 8 00:14:44 2014 @@ -134,7 +134,7 @@ /* Select current locale */ /* or should it be System and not user? */ - GetLocaleInfo(lcid, LOCALE_SSORTNAME, lang, sizeof(lang)); + GetLocaleInfo(lcid, LOCALE_SSORTNAME, lang, sizeof(lang)/sizeof(TCHAR)); SendMessage(hwnd, CB_SELECTSTRING,
10 years, 8 months
1
0
0
0
[khornicek] 62684: [DESK] - fix a bunch of buffer overruns, negative array index accesses and uninitialized variables CID #1102296 CID #501468 CID #716755 CID #716756 CID #1102323
by khornicek@svn.reactos.org
Author: khornicek Date: Mon Apr 7 23:36:39 2014 New Revision: 62684 URL:
http://svn.reactos.org/svn/reactos?rev=62684&view=rev
Log: [DESK] - fix a bunch of buffer overruns, negative array index accesses and uninitialized variables CID #1102296 CID #501468 CID #716755 CID #716756 CID #1102323 Modified: trunk/reactos/dll/cpl/desk/advappdlg.c trunk/reactos/dll/cpl/desk/draw.c trunk/reactos/dll/cpl/desk/general.c trunk/reactos/dll/cpl/desk/screensaver.c Modified: trunk/reactos/dll/cpl/desk/advappdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/advappdlg.c?r…
============================================================================== --- trunk/reactos/dll/cpl/desk/advappdlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/advappdlg.c [iso-8859-1] Mon Apr 7 23:36:39 2014 @@ -275,7 +275,7 @@ plfFont->lfHeight = -MulDiv(GetDlgItemInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E, &bTranslated, FALSE), GetDeviceCaps(hdcDlg, LOGPIXELSY), 72); plfFont->lfWeight = (SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTBOLD, BM_GETCHECK, 0, 0) == 1) ? FW_BOLD : FW_NORMAL; plfFont->lfItalic = (BYTE)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTITALIC, BM_GETCHECK, 0, 0); - GetDlgItemText(hwndDlg, IDC_ADVAPPEARANCE_FONT_C, plfFont->lfFaceName, LF_FACESIZE * sizeof(TCHAR)); + GetDlgItemText(hwndDlg, IDC_ADVAPPEARANCE_FONT_C, plfFont->lfFaceName, LF_FACESIZE); } ReleaseDC(hwndDlg, hdcDlg); Modified: trunk/reactos/dll/cpl/desk/draw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/draw.c?rev=62…
============================================================================== --- trunk/reactos/dll/cpl/desk/draw.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/draw.c [iso-8859-1] Mon Apr 7 23:36:39 2014 @@ -69,6 +69,8 @@ int LTpenplus = 0; int RTpenplus = 0; int RBpenplus = 0; + HBRUSH hbr; + /* Init some vars */ LTInnerPen = LTOuterPen = RBInnerPen = RBOuterPen = (HPEN)GetStockObject(NULL_PEN); SavePen = (HPEN)SelectObject(hdc, LTInnerPen); @@ -88,76 +90,84 @@ if((uFlags & BF_TOPLEFT) == BF_TOPLEFT) LTpenplus = 1; + if((uFlags & MY_BF_ACTIVEBORDER)) + hbr = CreateSolidBrush(scheme->crColor[COLOR_ACTIVEBORDER]); + else + hbr = CreateSolidBrush(scheme->crColor[COLOR_BTNFACE]); + + FillRect(hdc, &InnerRect, hbr); + DeleteObject(hbr); + + MoveToEx(hdc, 0, 0, &SavePoint); + + /* Draw the outer edge */ + if(LTOuterI != -1) + { + LTOuterPen = GetStockObject(DC_PEN); + SelectObject(hdc, LTOuterPen); + SetDCPenColor(hdc, scheme->crColor[LTOuterI]); + if(uFlags & BF_TOP) + { + MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL); + LineTo(hdc, InnerRect.right, InnerRect.top); + } + if(uFlags & BF_LEFT) + { + MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL); + LineTo(hdc, InnerRect.left, InnerRect.bottom); + } + } + + if(RBOuterI != -1) + { + RBOuterPen = GetStockObject(DC_PEN); + SelectObject(hdc, RBOuterPen); + SetDCPenColor(hdc, scheme->crColor[RBOuterI]); + if(uFlags & BF_BOTTOM) + { + MoveToEx(hdc, InnerRect.left, InnerRect.bottom-1, NULL); + LineTo(hdc, InnerRect.right, InnerRect.bottom-1); + } + if(uFlags & BF_RIGHT) + { + MoveToEx(hdc, InnerRect.right-1, InnerRect.top, NULL); + LineTo(hdc, InnerRect.right-1, InnerRect.bottom); + } + } + + /* Draw the inner edge */ if(LTInnerI != -1) + { LTInnerPen = GetStockObject(DC_PEN); - if(LTOuterI != -1) - LTOuterPen = GetStockObject(DC_PEN); + SelectObject(hdc, LTInnerPen); + SetDCPenColor(hdc, scheme->crColor[LTInnerI]); + if(uFlags & BF_TOP) + { + MoveToEx(hdc, InnerRect.left+LTpenplus, InnerRect.top+1, NULL); + LineTo(hdc, InnerRect.right-RTpenplus, InnerRect.top+1); + } + if(uFlags & BF_LEFT) + { + MoveToEx(hdc, InnerRect.left+1, InnerRect.top+LTpenplus, NULL); + LineTo(hdc, InnerRect.left+1, InnerRect.bottom-LBpenplus); + } + } + if(RBInnerI != -1) + { RBInnerPen = GetStockObject(DC_PEN); - if(RBOuterI != -1) - RBOuterPen = GetStockObject(DC_PEN); - { - HBRUSH hbr; - - if((uFlags & MY_BF_ACTIVEBORDER)) - hbr = CreateSolidBrush(scheme->crColor[COLOR_ACTIVEBORDER]); - else - hbr = CreateSolidBrush(scheme->crColor[COLOR_BTNFACE]); - FillRect(hdc, &InnerRect, hbr); - DeleteObject(hbr); - } - MoveToEx(hdc, 0, 0, &SavePoint); - - /* Draw the outer edge */ - SelectObject(hdc, LTOuterPen); - SetDCPenColor(hdc, scheme->crColor[LTOuterI]); - if(uFlags & BF_TOP) - { - MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL); - LineTo(hdc, InnerRect.right, InnerRect.top); - } - if(uFlags & BF_LEFT) - { - MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL); - LineTo(hdc, InnerRect.left, InnerRect.bottom); - } - SelectObject(hdc, RBOuterPen); - SetDCPenColor(hdc, scheme->crColor[RBOuterI]); - if(uFlags & BF_BOTTOM) - { - MoveToEx(hdc, InnerRect.left, InnerRect.bottom-1, NULL); - LineTo(hdc, InnerRect.right, InnerRect.bottom-1); - } - if(uFlags & BF_RIGHT) - { - MoveToEx(hdc, InnerRect.right-1, InnerRect.top, NULL); - LineTo(hdc, InnerRect.right-1, InnerRect.bottom); - } - - /* Draw the inner edge */ - SelectObject(hdc, LTInnerPen); - SetDCPenColor(hdc, scheme->crColor[LTInnerI]); - if(uFlags & BF_TOP) - { - MoveToEx(hdc, InnerRect.left+LTpenplus, InnerRect.top+1, NULL); - LineTo(hdc, InnerRect.right-RTpenplus, InnerRect.top+1); - } - if(uFlags & BF_LEFT) - { - MoveToEx(hdc, InnerRect.left+1, InnerRect.top+LTpenplus, NULL); - LineTo(hdc, InnerRect.left+1, InnerRect.bottom-LBpenplus); - } - SelectObject(hdc, RBInnerPen); - SetDCPenColor(hdc, scheme->crColor[RBInnerI]); - if(uFlags & BF_BOTTOM) - { - MoveToEx(hdc, InnerRect.left+LBpenplus, InnerRect.bottom-2, NULL); - LineTo(hdc, InnerRect.right-RBpenplus, InnerRect.bottom-2); - } - if(uFlags & BF_RIGHT) - { - MoveToEx(hdc, InnerRect.right-2, InnerRect.top+RTpenplus, NULL); - LineTo(hdc, InnerRect.right-2, InnerRect.bottom-RBpenplus); + SelectObject(hdc, RBInnerPen); + SetDCPenColor(hdc, scheme->crColor[RBInnerI]); + if(uFlags & BF_BOTTOM) + { + MoveToEx(hdc, InnerRect.left+LBpenplus, InnerRect.bottom-2, NULL); + LineTo(hdc, InnerRect.right-RBpenplus, InnerRect.bottom-2); + } + if(uFlags & BF_RIGHT) + { + MoveToEx(hdc, InnerRect.right-2, InnerRect.top+RTpenplus, NULL); + LineTo(hdc, InnerRect.right-2, InnerRect.bottom-RBpenplus); + } } if (uFlags & BF_ADJUST) @@ -245,6 +255,8 @@ case DFCS_CAPTIONRESTORE: Symbol = '2'; break; + default: + return FALSE; } MyIntDrawRectEdge(dc, r, (uFlags & DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED, BF_RECT | BF_MIDDLE | BF_SOFT, scheme); ZeroMemory(&lf, sizeof(LOGFONT)); @@ -313,6 +325,9 @@ case DFCS_SCROLLRIGHT: Symbol = '4'; break; + + default: + return FALSE; } MyIntDrawRectEdge(dc, r, (uFlags & DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED, (uFlags&DFCS_FLAT) | BF_MIDDLE | BF_RECT, scheme); ZeroMemory(&lf, sizeof(LOGFONT)); Modified: trunk/reactos/dll/cpl/desk/general.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/general.c?rev…
============================================================================== --- trunk/reactos/dll/cpl/desk/general.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/general.c [iso-8859-1] Mon Apr 7 23:36:39 2014 @@ -33,7 +33,7 @@ TCHAR Buffer[LINE_LEN]; TCHAR Desc[LINE_LEN]; - if (SetupGetStringField(&Context, 0, Buffer, sizeof(Buffer), NULL) && + if (SetupGetStringField(&Context, 0, Buffer, sizeof(Buffer) / sizeof(TCHAR), NULL) && SetupGetIntField(&Context, 1, &ci)) { _stprintf(Desc, _T("%s (%d DPI)"), Buffer, ci); Modified: trunk/reactos/dll/cpl/desk/screensaver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/screensaver.c…
============================================================================== --- trunk/reactos/dll/cpl/desk/screensaver.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/screensaver.c [iso-8859-1] Mon Apr 7 23:36:39 2014 @@ -340,7 +340,6 @@ ScreenSaverCount = pData->ScreenSaverCount; - hr = StringCbCopy(szSearchPath, sizeof(szSearchPath), pszSearchPath); if (FAILED(hr)) return;
10 years, 8 months
1
0
0
0
[aandrejevic] 62683: [BASESRV] Fix BaseSrvCheckVDM - DOS records should be initialized with a state of VDM_NOT_LOADED. Fix BaseSrvFillCommandInfo - Check the size of the buffers. Start implementing...
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Mon Apr 7 23:16:22 2014 New Revision: 62683 URL:
http://svn.reactos.org/svn/reactos?rev=62683&view=rev
Log: [BASESRV] Fix BaseSrvCheckVDM - DOS records should be initialized with a state of VDM_NOT_LOADED. Fix BaseSrvFillCommandInfo - Check the size of the buffers. Start implementing BaseSrvGetNextVDMCommand. Modified: branches/ntvdm/dll/win32/kernel32/include/vdm.h branches/ntvdm/include/reactos/subsys/win/vdm.h branches/ntvdm/subsystems/win/basesrv/vdm.c branches/ntvdm/subsystems/win/basesrv/vdm.h Modified: branches/ntvdm/dll/win32/kernel32/include/vdm.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/dll/win32/kernel32/includ…
============================================================================== --- branches/ntvdm/dll/win32/kernel32/include/vdm.h [iso-8859-1] (original) +++ branches/ntvdm/dll/win32/kernel32/include/vdm.h [iso-8859-1] Mon Apr 7 23:16:22 2014 @@ -66,4 +66,17 @@ IN HANDLE hUserToken OPTIONAL ); +BOOL +WINAPI +GetNextVDMCommand( + IN OUT PVDM_COMMAND_INFO CommandData OPTIONAL +); + +VOID +WINAPI +ExitVDM( + IN BOOL IsWow, + IN ULONG iWowTask +); + /* EOF */ Modified: branches/ntvdm/include/reactos/subsys/win/vdm.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/include/reactos/subsys/wi…
============================================================================== --- branches/ntvdm/include/reactos/subsys/win/vdm.h [iso-8859-1] (original) +++ branches/ntvdm/include/reactos/subsys/win/vdm.h [iso-8859-1] Mon Apr 7 23:16:22 2014 @@ -50,6 +50,7 @@ // // VDM Magic Values // +#define VDM_FLAG_WOW 0x02 #define VDM_INC_REENTER_COUNT 0x10 #define VDM_DEC_REENTER_COUNT 0x20 Modified: branches/ntvdm/subsystems/win/basesrv/vdm.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/win/basesrv/vd…
============================================================================== --- branches/ntvdm/subsystems/win/basesrv/vdm.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/win/basesrv/vdm.c [iso-8859-1] Mon Apr 7 23:16:22 2014 @@ -366,7 +366,7 @@ return Success; } -VOID NTAPI BaseSrvFillCommandInfo(PVDM_COMMAND_INFO CommandInfo, +NTSTATUS NTAPI BaseSrvFillCommandInfo(PVDM_COMMAND_INFO CommandInfo, PBASE_GET_NEXT_VDM_COMMAND Message) { /* Copy the data */ @@ -381,36 +381,46 @@ Message->VDMState = CommandInfo->VDMState; Message->fComingFromBat = CommandInfo->ComingFromBat; - if (CommandInfo->CmdLen) - { + if (CommandInfo->CmdLen && Message->CmdLen) + { + if (Message->CmdLen < CommandInfo->CmdLen) return STATUS_BUFFER_TOO_SMALL; + /* Copy the command line */ RtlMoveMemory(Message->CmdLine, CommandInfo->CmdLine, CommandInfo->CmdLen); Message->CmdLen = CommandInfo->CmdLen; } - if (CommandInfo->AppLen) - { + if (CommandInfo->AppLen && Message->AppLen) + { + if (Message->AppLen < CommandInfo->CmdLen) return STATUS_BUFFER_TOO_SMALL; + /* Copy the application name */ RtlMoveMemory(Message->AppName, CommandInfo->AppName, CommandInfo->AppLen); Message->AppLen = CommandInfo->AppLen; } - if (CommandInfo->PifLen) - { + if (CommandInfo->PifLen && Message->PifLen) + { + if (Message->PifLen < CommandInfo->PifLen) return STATUS_BUFFER_TOO_SMALL; + /* Copy the PIF file name */ RtlMoveMemory(Message->PifFile, CommandInfo->PifFile, CommandInfo->PifLen); Message->PifLen = CommandInfo->PifLen; } - if (CommandInfo->CurDirectoryLen) - { + if (CommandInfo->CurDirectoryLen && Message->CurDirectoryLen) + { + if (Message->CurDirectoryLen < CommandInfo->CurDirectoryLen) return STATUS_BUFFER_TOO_SMALL; + /* Copy the current directory */ RtlMoveMemory(Message->CurDirectory, CommandInfo->CurDirectory, CommandInfo->CurDirectoryLen); Message->CurDirectoryLen = CommandInfo->CurDirectoryLen; } - if (CommandInfo->EnvLen) - { + if (CommandInfo->EnvLen && Message->EnvLen) + { + if (Message->EnvLen < CommandInfo->EnvLen) return STATUS_BUFFER_TOO_SMALL; + /* Copy the environment */ RtlMoveMemory(Message->Env, CommandInfo->Env, CommandInfo->EnvLen); Message->EnvLen = CommandInfo->EnvLen; @@ -421,26 +431,34 @@ &CommandInfo->StartupInfo, sizeof(STARTUPINFOA)); - if (CommandInfo->DesktopLen) - { + if (CommandInfo->DesktopLen && Message->DesktopLen) + { + if (Message->DesktopLen < CommandInfo->DesktopLen) return STATUS_BUFFER_TOO_SMALL; + /* Copy the desktop name */ RtlMoveMemory(Message->Desktop, CommandInfo->Desktop, CommandInfo->DesktopLen); Message->DesktopLen = CommandInfo->DesktopLen; } - if (CommandInfo->TitleLen) - { + if (CommandInfo->TitleLen && Message->TitleLen) + { + if (Message->TitleLen < CommandInfo->TitleLen) return STATUS_BUFFER_TOO_SMALL; + /* Copy the title */ RtlMoveMemory(Message->Title, CommandInfo->Title, CommandInfo->TitleLen); Message->TitleLen = CommandInfo->TitleLen; } - if (CommandInfo->ReservedLen) - { + if (CommandInfo->ReservedLen && Message->ReservedLen) + { + if (Message->ReservedLen < CommandInfo->ReservedLen) return STATUS_BUFFER_TOO_SMALL; + /* Copy the reserved parameter */ RtlMoveMemory(Message->Reserved, CommandInfo->Reserved, CommandInfo->ReservedLen); Message->ReservedLen = CommandInfo->ReservedLen; } + + return STATUS_SUCCESS; } VOID NTAPI BaseInitializeVDM(VOID) @@ -459,7 +477,6 @@ { NTSTATUS Status; PBASE_CHECK_VDM CheckVdmRequest = &((PBASE_API_MESSAGE)ApiMessage)->Data.CheckVDMRequest; - PCSR_PROCESS ClientProcess; PRTL_CRITICAL_SECTION CriticalSection = NULL; PVDM_CONSOLE_RECORD ConsoleRecord = NULL; PVDM_DOS_RECORD DosRecord = NULL; @@ -500,11 +517,6 @@ { return STATUS_INVALID_PARAMETER; } - - /* Lock the process */ - Status = CsrLockProcessByClientId(ApiMessage->Header.ClientId.UniqueProcess, - &ClientProcess); - if (!NT_SUCCESS(Status)) return Status; CriticalSection = (CheckVdmRequest->BinaryType != BINARY_TYPE_SEPARATE_WOW) ? &DosCriticalSection @@ -532,19 +544,18 @@ goto Cleanup; } + /* Remember that the console record was allocated here */ + NewConsoleRecord = TRUE; + /* Initialize the console record */ ConsoleRecord->ConsoleHandle = CheckVdmRequest->ConsoleHandle; - ConsoleRecord->ProcessHandle = ClientProcess->ProcessHandle; + ConsoleRecord->ProcessHandle = CsrGetClientThread()->Process->ProcessHandle; ConsoleRecord->ServerEvent = ConsoleRecord->ClientEvent = NULL; ConsoleRecord->ReenterCount = 0; ConsoleRecord->CurrentDirs = NULL; ConsoleRecord->CurDirsLength = 0; ConsoleRecord->SessionId = GetNextDosSesId(); InitializeListHead(&ConsoleRecord->DosListHead); - // TODO: The console record structure is incomplete - - /* Remember that the console record was allocated here */ - NewConsoleRecord = TRUE; } /* Allocate a new DOS record */ @@ -558,9 +569,8 @@ } /* Initialize the DOS record */ - DosRecord->State = NewConsoleRecord ? VDM_NOT_LOADED : VDM_READY; + DosRecord->State = VDM_NOT_LOADED; DosRecord->ExitCode = 0; - // TODO: The DOS record structure is incomplete Status = BaseSrvCreatePairWaitHandles(&DosRecord->ServerEvent, &DosRecord->ClientEvent); if (!NT_SUCCESS(Status)) goto Cleanup; @@ -579,13 +589,19 @@ /* Add the DOS record */ InsertHeadList(&ConsoleRecord->DosListHead, &DosRecord->Entry); + if (ConsoleRecord->ServerEvent) + { + /* Signal the session event */ + NtSetEvent(ConsoleRecord->ServerEvent, NULL); + } + if (NewConsoleRecord) { /* Add the console record */ InsertTailList(&VDMConsoleListHead, &ConsoleRecord->Entry); } - CheckVdmRequest->VDMState = DosRecord->State; + CheckVdmRequest->VDMState = NewConsoleRecord ? VDM_NOT_LOADED : VDM_READY; Status = STATUS_SUCCESS; } else @@ -630,9 +646,6 @@ /* Leave the critical section */ RtlLeaveCriticalSection(CriticalSection); - /* Unlock the process */ - CsrUnlockProcess(ClientProcess); - return Status; } @@ -695,6 +708,7 @@ */ if (ConsoleRecord->DosListHead.Flink == &ConsoleRecord->DosListHead) { + if (ConsoleRecord->ServerEvent) NtClose(ConsoleRecord->ServerEvent); RemoveEntryList(&ConsoleRecord->Entry); RtlFreeHeap(BaseSrvHeap, 0, ConsoleRecord); } @@ -761,8 +775,149 @@ CSR_API(BaseSrvGetNextVDMCommand) { - DPRINT1("%s not yet implemented\n", __FUNCTION__); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS Status; + PBASE_GET_NEXT_VDM_COMMAND GetNextVdmCommandRequest = + &((PBASE_API_MESSAGE)ApiMessage)->Data.GetNextVDMCommandRequest; + PRTL_CRITICAL_SECTION CriticalSection; + PLIST_ENTRY i = NULL; + PVDM_CONSOLE_RECORD ConsoleRecord = NULL; + PVDM_DOS_RECORD DosRecord = NULL; + + /* Validate the message buffers */ + if (!CsrValidateMessageBuffer(ApiMessage, + (PVOID*)&GetNextVdmCommandRequest->CmdLine, + GetNextVdmCommandRequest->CmdLen, + sizeof(*GetNextVdmCommandRequest->CmdLine)) + || !CsrValidateMessageBuffer(ApiMessage, + (PVOID*)&GetNextVdmCommandRequest->AppName, + GetNextVdmCommandRequest->AppLen, + sizeof(*GetNextVdmCommandRequest->AppName)) + || !CsrValidateMessageBuffer(ApiMessage, + (PVOID*)&GetNextVdmCommandRequest->PifFile, + GetNextVdmCommandRequest->PifLen, + sizeof(*GetNextVdmCommandRequest->PifFile)) + || !CsrValidateMessageBuffer(ApiMessage, + (PVOID*)&GetNextVdmCommandRequest->CurDirectory, + GetNextVdmCommandRequest->CurDirectoryLen, + sizeof(*GetNextVdmCommandRequest->CurDirectory)) + || !CsrValidateMessageBuffer(ApiMessage, + (PVOID*)&GetNextVdmCommandRequest->Env, + GetNextVdmCommandRequest->EnvLen, + sizeof(*GetNextVdmCommandRequest->Env)) + || !CsrValidateMessageBuffer(ApiMessage, + (PVOID*)&GetNextVdmCommandRequest->Desktop, + GetNextVdmCommandRequest->DesktopLen, + sizeof(*GetNextVdmCommandRequest->Desktop)) + || !CsrValidateMessageBuffer(ApiMessage, + (PVOID*)&GetNextVdmCommandRequest->Title, + GetNextVdmCommandRequest->TitleLen, + sizeof(*GetNextVdmCommandRequest->Title)) + || !CsrValidateMessageBuffer(ApiMessage, + (PVOID*)&GetNextVdmCommandRequest->Reserved, + GetNextVdmCommandRequest->ReservedLen, + sizeof(*GetNextVdmCommandRequest->Reserved)) + || !CsrValidateMessageBuffer(ApiMessage, + (PVOID*)&GetNextVdmCommandRequest->StartupInfo, + 1, + sizeof(STARTUPINFOA))) + { + return STATUS_INVALID_PARAMETER; + } + + CriticalSection = (GetNextVdmCommandRequest->VDMState & VDM_FLAG_WOW) + ? &WowCriticalSection + : &DosCriticalSection; + + /* Enter the critical section */ + RtlEnterCriticalSection(CriticalSection); + + if (!(GetNextVdmCommandRequest->VDMState & VDM_FLAG_WOW)) + { + if (GetNextVdmCommandRequest->iTask != 0) + { + /* Get the console record using the task ID */ + Status = GetConsoleRecordBySessionId(GetNextVdmCommandRequest->iTask, + &ConsoleRecord); + } + else + { + /* Get the console record using the console handle */ + Status = BaseSrvGetConsoleRecord(GetNextVdmCommandRequest->ConsoleHandle, + &ConsoleRecord); + } + + /* Return the session ID */ + GetNextVdmCommandRequest->iTask = ConsoleRecord->SessionId; + GetNextVdmCommandRequest->WaitObjectForVDM = NULL; + + // HACK: I'm not sure if this should happen... + for (i = ConsoleRecord->DosListHead.Flink; i != &ConsoleRecord->DosListHead; i = i->Flink) + { + DosRecord = CONTAINING_RECORD(i, VDM_DOS_RECORD, Entry); + if (DosRecord->State == VDM_NOT_READY) + { + /* If NTVDM is asking for a new command, it means these are done */ + DosRecord->State = VDM_READY; + + NtSetEvent(DosRecord->ServerEvent, NULL); + NtClose(DosRecord->ServerEvent); + DosRecord->ServerEvent = NULL; + } + } + + /* Search for a DOS record that isn't loaded yet */ + for (i = ConsoleRecord->DosListHead.Flink; i != &ConsoleRecord->DosListHead; i = i->Flink) + { + DosRecord = CONTAINING_RECORD(i, VDM_DOS_RECORD, Entry); + if (DosRecord->State == VDM_NOT_LOADED) break; + } + + if (i != &ConsoleRecord->DosListHead) + { + /* Fill the command information */ + Status = BaseSrvFillCommandInfo(DosRecord->CommandInfo, GetNextVdmCommandRequest); + if (!NT_SUCCESS(Status)) goto Cleanup; + + /* Free the command information, it's no longer needed */ + BaseSrvFreeVDMInfo(DosRecord->CommandInfo); + DosRecord->CommandInfo = NULL; + + /* Update the VDM state */ + DosRecord->State = VDM_NOT_READY; + + Status = STATUS_SUCCESS; + goto Cleanup; + } + } + else + { + // TODO: WOW SUPPORT NOT IMPLEMENTED + Status = STATUS_NOT_IMPLEMENTED; + goto Cleanup; + } + + /* There is no command yet */ + if (ConsoleRecord->ServerEvent) + { + /* Reset the event */ + NtResetEvent(ConsoleRecord->ServerEvent, NULL); + } + else + { + /* Create a pair of wait handles */ + Status = BaseSrvCreatePairWaitHandles(&ConsoleRecord->ServerEvent, + &ConsoleRecord->ClientEvent); + if (!NT_SUCCESS(Status)) goto Cleanup; + } + + /* Return the client event handle */ + GetNextVdmCommandRequest->WaitObjectForVDM = ConsoleRecord->ClientEvent; + +Cleanup: + /* Leave the critical section */ + RtlLeaveCriticalSection(CriticalSection); + + return Status; } CSR_API(BaseSrvExitVDM) @@ -811,6 +966,9 @@ ConsoleRecord->CurDirsLength = 0; } + /* Close the event handle */ + if (ConsoleRecord->ServerEvent) NtClose(ConsoleRecord->ServerEvent); + /* Remove the console record */ RemoveEntryList(&ConsoleRecord->Entry); RtlFreeHeap(BaseSrvHeap, 0, ConsoleRecord); Modified: branches/ntvdm/subsystems/win/basesrv/vdm.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/win/basesrv/vd…
============================================================================== --- branches/ntvdm/subsystems/win/basesrv/vdm.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/win/basesrv/vdm.h [iso-8859-1] Mon Apr 7 23:16:22 2014 @@ -28,7 +28,6 @@ ULONG CurDirsLength; ULONG SessionId; LIST_ENTRY DosListHead; - // TODO: Structure incomplete!!! } VDM_CONSOLE_RECORD, *PVDM_CONSOLE_RECORD; typedef struct _VDM_DOS_RECORD @@ -39,7 +38,6 @@ HANDLE ServerEvent; HANDLE ClientEvent; PVDM_COMMAND_INFO CommandInfo; - // TODO: Structure incomplete!!! } VDM_DOS_RECORD, *PVDM_DOS_RECORD; /* FUNCTIONS ******************************************************************/
10 years, 8 months
1
0
0
0
[khornicek] 62682: [SHUTDOWN] - fix a typo in the czech translation [CONSOLE] - fix a buffer overrun CID #1102302 - update and fix the czech translation [MAIN] - fix the fix by taking the null term...
by khornicek@svn.reactos.org
Author: khornicek Date: Mon Apr 7 22:02:26 2014 New Revision: 62682 URL:
http://svn.reactos.org/svn/reactos?rev=62682&view=rev
Log: [SHUTDOWN] - fix a typo in the czech translation [CONSOLE] - fix a buffer overrun CID #1102302 - update and fix the czech translation [MAIN] - fix the fix by taking the null terminator into account Modified: trunk/reactos/base/applications/shutdown/lang/cs-CZ.rc trunk/reactos/dll/cpl/console/console.c trunk/reactos/dll/cpl/console/lang/cs-CZ.rc trunk/reactos/dll/cpl/main/mouse.c Modified: trunk/reactos/base/applications/shutdown/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/shutdown…
============================================================================== --- trunk/reactos/base/applications/shutdown/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/shutdown/lang/cs-CZ.rc [iso-8859-1] Mon Apr 7 22:02:26 2014 @@ -8,7 +8,7 @@ /* Dialog */ IDD_GUI DIALOGEX 0, 0, 240, 255 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Vzrálené vypnutÃ" +CAPTION "Vzdálené vypnutÃ" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "&OK", IDC_OK, 125, 232, 50, 14 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] Mon Apr 7 22:02:26 2014 @@ -327,9 +327,9 @@ if (pConInfo->ci.ConsoleTitle[0] != L'\0') { - wcsncpy(szTitle, L"\"", sizeof(szTitle) / sizeof(szTitle[0])); - wcsncat(szTitle, pConInfo->ci.ConsoleTitle, sizeof(szTitle) / sizeof(szTitle[0])); - wcsncat(szTitle, L"\"", sizeof(szTitle) / sizeof(szTitle[0])); + wcsncpy(szTitle, L"\"", MAX_PATH); + wcsncat(szTitle, pConInfo->ci.ConsoleTitle, MAX_PATH - wcslen(szTitle)); + wcsncat(szTitle, L"\"", MAX_PATH - wcslen(szTitle)); } else { Modified: trunk/reactos/dll/cpl/console/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/cs-CZ…
============================================================================== --- trunk/reactos/dll/cpl/console/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/lang/cs-CZ.rc [iso-8859-1] Mon Apr 7 22:02:26 2014 @@ -1,4 +1,4 @@ -/* +/* * FILE: dll/cpl/console/lang/cs-CZ.rc * TRANSLATOR: Radek Liska aka Black_Fox (radekliska at gmail dot com) * UPDATED: 2011-03-31 @@ -19,11 +19,11 @@ CONTROL "&Okno", IDC_RADIO_DISPLAY_WINDOW, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 142, 20, 70, 10 CONTROL "&Celá obrazovka", IDC_RADIO_DISPLAY_FULL, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 142, 40, 70, 10 GROUPBOX "Historie pÅÃkazů", -1, 7, 85, 120, 77, WS_CHILD | WS_VISIBLE | WS_GROUP - LTEXT "Velikost v&yrovnávacà pamÄti:", -1, 14, 101, 70, 12 + LTEXT "&Velikost pamÄti:", -1, 14, 101, 70, 12 EDITTEXT IDC_EDIT_BUFFER_SIZE, 90, 97, 30, 15, ES_RIGHT | ES_NUMBER | WS_GROUP CONTROL "", IDC_UPDOWN_BUFFER_SIZE, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_GROUP, 119, 97, 12, 15 - LTEXT "&PoÄet vyrovnávacÃch pamÄtÃ:", -1, 14, 124, 70, 12 + LTEXT "&PoÄet pamÄtÃ:", -1, 14, 124, 70, 12 EDITTEXT IDC_EDIT_NUM_BUFFER, 90, 120, 30, 15, ES_RIGHT | ES_NUMBER | WS_GROUP CONTROL "", IDC_UPDOWN_NUM_BUFFER, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_GROUP, 119, 120, 12, 15 @@ -60,7 +60,7 @@ BEGIN LTEXT "Náhled okna:", -1, 8, 6, 95, 10 CONTROL "", IDC_STATIC_LAYOUT_WINDOW_PREVIEW, "Static", SS_SUNKEN | SS_OWNERDRAW, 8, 16, 115, 70 - GROUPBOX "Velikost bufferu zobrazenÃ", -1, 130, 12, 115, 50 + GROUPBOX "Velikost pamÄti zobrazenÃ", -1, 130, 12, 115, 50 LTEXT "&Å ÃÅka:", -1, 140, 28, 40, 10 LTEXT "&Výška:", -1, 140, 46, 39, 10 EDITTEXT IDC_EDIT_SCREEN_BUFFER_WIDTH, 203, 25, 35, 14, ES_RIGHT | ES_NUMBER | WS_GROUP @@ -103,7 +103,7 @@ WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 48, 112, 10 CONTROL "Pozadà vý&bÄru", IDC_RADIO_POPUP_BACKGROUND, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 67, 112, 10 - GROUPBOX "Selected Color Components", -1, 129, 7, 118, 73 + GROUPBOX "Zvolené barevné složky", -1, 129, 7, 118, 73 LTEXT "Äe&rvená:", -1, 140, 25, 48, 10 EDITTEXT IDC_EDIT_COLOR_RED, 210, 22, 30, 14, ES_RIGHT | ES_NUMBER | WS_GROUP CONTROL "", IDC_UPDOWN_COLOR_RED, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | @@ -132,9 +132,9 @@ CONTROL "", IDC_STATIC_COLOR14, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 199, 90, 12, 12 CONTROL "", IDC_STATIC_COLOR15, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 213, 90, 12, 12 CONTROL "", IDC_STATIC_COLOR16, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 227, 90, 12, 12 - GROUPBOX "Preview (Screen)", -1, 7, 111, 240, 40 + GROUPBOX "Náhled (obrazovka)", -1, 7, 111, 240, 40 CONTROL "", IDC_STATIC_SCREEN_COLOR, "Static", SS_OWNERDRAW | SS_SUNKEN, 15, 124, 224, 20 - GROUPBOX "Preview (Popup)", -1, 7, 162, 240, 40 + GROUPBOX "Náhled (mÃstnà nabÃdka)", -1, 7, 162, 240, 40 CONTROL "", IDC_STATIC_POPUP_COLOR, "Static", SS_OWNERDRAW | SS_SUNKEN, 15, 176, 224, 20 END Modified: trunk/reactos/dll/cpl/main/mouse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/mouse.c?rev=6…
============================================================================== --- trunk/reactos/dll/cpl/main/mouse.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/main/mouse.c [iso-8859-1] Mon Apr 7 22:02:26 2014 @@ -1109,8 +1109,8 @@ else if (dwSchemeSource == 2) { LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH); - _tcsncat(szSchemeName, _T(" "), MAX_PATH - _tcslen(szSchemeName)); - _tcsncat(szSchemeName, szSystemScheme, MAX_PATH - _tcslen(szSchemeName)); + _tcsncat(szSchemeName, _T(" "), MAX_PATH - _tcslen(szSchemeName) - 1); + _tcsncat(szSchemeName, szSystemScheme, MAX_PATH - _tcslen(szSchemeName) - 1); } /* Search and select the curent scheme name from the scheme list */
10 years, 8 months
1
0
0
0
[dquintana] 62681: [RSHELL] * Some code improvements, refactoring, and commenting. * Using alternative method of handling hot-tracking, which does not break in win2003. CORE-7586
by dquintana@svn.reactos.org
Author: dquintana Date: Mon Apr 7 18:41:47 2014 New Revision: 62681 URL:
http://svn.reactos.org/svn/reactos?rev=62681&view=rev
Log: [RSHELL] * Some code improvements, refactoring, and commenting. * Using alternative method of handling hot-tracking, which does not break in win2003. CORE-7586 Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp branches/shell-experiments/base/shell/rshell/CMenuBand.h branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp branches/shell-experiments/base/shell/rshell/CMenuToolbars.h Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Mon Apr 7 18:41:47 2014 @@ -260,26 +260,26 @@ HRESULT STDMETHODCALLTYPE CMenuBand::OnPosRectChangeDB(RECT *prc) { - SIZE sizeStatic = { 0 }; - SIZE sizeShlFld = { 0 }; + SIZE maxStatic = { 0 }; + SIZE maxShlFld = { 0 }; HRESULT hr = S_OK; if (m_staticToolbar != NULL) - hr = m_staticToolbar->GetIdealSize(sizeStatic); + hr = m_staticToolbar->GetSizes(NULL, &maxStatic, NULL); if (FAILED_UNEXPECTEDLY(hr)) return hr; if (m_SFToolbar != NULL) - hr = m_SFToolbar->GetIdealSize(sizeShlFld); + hr = m_SFToolbar->GetSizes(NULL, &maxShlFld, NULL); if (FAILED_UNEXPECTEDLY(hr)) return hr; if (m_staticToolbar == NULL && m_SFToolbar == NULL) return E_FAIL; - int sy = min(prc->bottom - prc->top, sizeStatic.cy + sizeShlFld.cy); - - int syStatic = sizeStatic.cy; + int sy = min(prc->bottom - prc->top, maxStatic.cy + maxShlFld.cy); + + int syStatic = maxStatic.cy; int syShlFld = sy - syStatic; if (m_SFToolbar) @@ -306,28 +306,46 @@ DWORD dwViewMode, DESKBANDINFO *pdbi) { - SIZE sizeStatic = { 0 }; - SIZE sizeShlFld = { 0 }; + SIZE minStatic = { 0 }; + SIZE minShlFld = { 0 }; + SIZE maxStatic = { 0 }; + SIZE maxShlFld = { 0 }; + SIZE intStatic = { 0 }; + SIZE intShlFld = { 0 }; HRESULT hr = S_OK; if (m_staticToolbar != NULL) - hr = m_staticToolbar->GetIdealSize(sizeStatic); + hr = m_staticToolbar->GetSizes(&minStatic, &maxStatic, &intStatic); if (FAILED_UNEXPECTEDLY(hr)) return hr; if (m_SFToolbar != NULL) - hr = m_SFToolbar->GetIdealSize(sizeShlFld); + hr = m_SFToolbar->GetSizes(&minShlFld, &maxShlFld, &intShlFld); if (FAILED_UNEXPECTEDLY(hr)) return hr; if (m_staticToolbar == NULL && m_SFToolbar == NULL) return E_FAIL; - pdbi->ptMinSize.x = max(sizeStatic.cx, sizeShlFld.cx) + 20; - pdbi->ptMinSize.y = sizeStatic.cy + sizeShlFld.cy; - pdbi->ptMaxSize.x = max(sizeStatic.cx, sizeShlFld.cx) + 20; - pdbi->ptMaxSize.y = sizeStatic.cy + sizeShlFld.cy; + if (m_dwFlags & SMINIT_VERTICAL) + { + pdbi->ptMinSize.x = max(minStatic.cx, minStatic.cx) + 20; + pdbi->ptMinSize.y = minStatic.cy + minStatic.cy; + pdbi->ptMaxSize.x = max(maxStatic.cx, maxShlFld.cx) + 20; + pdbi->ptMaxSize.y = maxStatic.cy + maxShlFld.cy; + pdbi->dwModeFlags = DBIMF_VARIABLEHEIGHT; + } + else + { + pdbi->ptMinSize.x = minStatic.cx + minStatic.cx; + pdbi->ptMinSize.y = max(minStatic.cy, minStatic.cy); + pdbi->ptMaxSize.x = maxStatic.cx + maxShlFld.cx; + pdbi->ptMaxSize.y = max(maxStatic.cy, maxShlFld.cy); + } + pdbi->ptIntegral.x = max(intStatic.cx, intStatic.cx); + pdbi->ptIntegral.y = max(intStatic.cy, intShlFld.cy); + pdbi->ptActual = pdbi->ptMinSize; return S_OK; } @@ -652,12 +670,10 @@ smData.uId = id; smData.uIdParent = m_uId; smData.uIdAncestor = m_uIdAncestor; + smData.pidlItem = pidl; smData.hwnd = hwnd; - smData.pidlItem = pidl; - if (m_staticToolbar) - { + if (m_hmenu) smData.hmenu = m_hmenu; - } smData.pvUserData = NULL; if (m_SFToolbar) m_SFToolbar->GetShellFolder(NULL, &smData.pidlFolder, IID_PPV_ARG(IShellFolder, &smData.psf)); @@ -668,7 +684,7 @@ return hr; } -HRESULT CMenuBand::_TrackSubMenuUsingTrackPopupMenu(HMENU popup, INT x, INT y, RECT& rcExclude) +HRESULT CMenuBand::_TrackSubMenu(HMENU popup, INT x, INT y, RECT& rcExclude) { TPMPARAMS params = { sizeof(TPMPARAMS), rcExclude }; @@ -688,6 +704,41 @@ _DisableMouseTrack(FALSE); return S_OK; +} + +HRESULT CMenuBand::_TrackContextMenu(IContextMenu * contextMenu, INT x, INT y) +{ + HRESULT hr; + UINT uCommand; + HMENU popup = CreatePopupMenu(); + + if (popup == NULL) + return E_FAIL; + + hr = contextMenu->QueryContextMenu(popup, 0, 0, UINT_MAX, CMF_NORMAL); + if (FAILED_UNEXPECTEDLY(hr)) + { + DestroyMenu(popup); + return hr; + } + + HWND hwnd = m_menuOwner ? m_menuOwner : m_topLevelWindow; + + m_focusManager->PushTrackedPopup(popup); + uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, x, y, m_menuOwner, NULL); + m_focusManager->PopTrackedPopup(popup); + + if (uCommand == 0) + return S_FALSE; + + CMINVOKECOMMANDINFO cmi = { 0 }; + cmi.cbSize = sizeof(cmi); + cmi.lpVerb = MAKEINTRESOURCEA(uCommand); + cmi.hwnd = hwnd; + hr = contextMenu->InvokeCommand(&cmi); + + DestroyMenu(popup); + return hr; } HRESULT CMenuBand::_GetTopLevelWindow(HWND*topLevel) @@ -728,119 +779,91 @@ return S_OK; } +HRESULT CMenuBand::_KeyboardItemChange(DWORD change) +{ + HRESULT hr; + CMenuToolbarBase *tb = m_hotBar; + + if (!tb) + { + // If no hot item was selected + // choose the first toolbar (prefer shell-folder, which will be positionedat the top) + + if (m_SFToolbar) + tb = m_SFToolbar; + else + tb = m_staticToolbar; + } + + // Ask the first toolbar to change + hr = tb->KeyboardItemChange(change); + + if (hr != S_FALSE) + return hr; + + // Select the second toolbar based on the first + if (tb == m_SFToolbar) + tb = m_staticToolbar; + else + tb = m_SFToolbar; + + if (!tb) + return hr; + + // Ask the second toolbar to change + return tb->KeyboardItemChange(change == VK_DOWN ? VK_END : VK_HOME); +} + HRESULT CMenuBand::_MenuItemHotTrack(DWORD changeType) { HRESULT hr; - if (!(m_dwFlags & SMINIT_VERTICAL)) - { - if (changeType == MPOS_SELECTRIGHT) + + if (m_dwFlags & SMINIT_VERTICAL) + { + switch (changeType) { - SendMessageW(m_menuOwner, WM_CANCELMODE, 0, 0); - if (m_SFToolbar && (m_hotBar == m_SFToolbar || m_hotBar == NULL)) - { - DbgPrint("SF Toolbars in Horizontal menus is not implemented.\n"); - return S_FALSE; - } - else if (m_staticToolbar && m_hotBar == m_staticToolbar) - { - hr = m_staticToolbar->KeyboardItemChange(VK_DOWN); - if (hr == S_FALSE) - { - if (m_SFToolbar) - return m_SFToolbar->KeyboardItemChange(VK_HOME); - else - return m_staticToolbar->KeyboardItemChange(VK_HOME); - } + case VK_UP: + case VK_DOWN: + return _KeyboardItemChange(changeType); + + // TODO: Left/Right across multi-column menus, if they ever work. + case VK_LEFT: + changeType = MPOS_SELECTLEFT; + break; + case VK_RIGHT: + changeType = MPOS_SELECTRIGHT; + break; + } + } + else + { + // In horizontal menubars, left/right are equivalent to vertical's up/down + switch(changeType) + { + case VK_LEFT: + hr = _KeyboardItemChange(VK_UP); + if (hr != S_FALSE) return hr; - } + case VK_RIGHT: + hr = _KeyboardItemChange(VK_DOWN); + if (hr != S_FALSE) + return hr; } - else if (changeType == MPOS_SELECTLEFT) + } + + switch (changeType) + { + case MPOS_SELECTLEFT: + if (!m_subMenuParent) { - SendMessageW(m_menuOwner, WM_CANCELMODE, 0, 0); - if (m_staticToolbar && (m_hotBar == m_staticToolbar || m_hotBar == NULL)) - { - hr = m_staticToolbar->KeyboardItemChange(VK_UP); - if (hr == S_FALSE) - { - if (m_SFToolbar) - return m_SFToolbar->KeyboardItemChange(VK_END); - else - return m_staticToolbar->KeyboardItemChange(VK_END); - } - return hr; - } - else if (m_SFToolbar && m_hotBar == m_SFToolbar) - { - DbgPrint("SF Toolbars in Horizontal menus is not implemented.\n"); - return S_FALSE; - } + if (m_subMenuChild) + return m_subMenuChild->OnSelect(MPOS_CANCELLEVEL); + return S_OK; } - } - else if (changeType == VK_DOWN) - { - if (m_SFToolbar && (m_hotBar == m_SFToolbar || m_hotBar == NULL)) - { - hr = m_SFToolbar->KeyboardItemChange(VK_DOWN); - if (hr == S_FALSE) - { - if (m_staticToolbar) - return m_staticToolbar->KeyboardItemChange(VK_HOME); - else - return m_SFToolbar->KeyboardItemChange(VK_HOME); - } - return hr; - } - else if (m_staticToolbar && m_hotBar == m_staticToolbar) - { - hr = m_staticToolbar->KeyboardItemChange(VK_DOWN); - if (hr == S_FALSE) - { - if (m_SFToolbar) - return m_SFToolbar->KeyboardItemChange(VK_HOME); - else - return m_staticToolbar->KeyboardItemChange(VK_HOME); - } - return hr; - } - } - else if (changeType == VK_UP) - { - if (m_staticToolbar && (m_hotBar == m_staticToolbar || m_hotBar == NULL)) - { - hr = m_staticToolbar->KeyboardItemChange(VK_UP); - if (hr == S_FALSE) - { - if (m_SFToolbar) - return m_SFToolbar->KeyboardItemChange(VK_END); - else - return m_staticToolbar->KeyboardItemChange(VK_END); - } - return hr; - } - else if (m_SFToolbar && m_hotBar == m_SFToolbar) - { - hr = m_SFToolbar->KeyboardItemChange(VK_UP); - if (hr == S_FALSE) - { - if (m_staticToolbar) - return m_staticToolbar->KeyboardItemChange(VK_END); - else - return m_SFToolbar->KeyboardItemChange(VK_END); - } - return hr; - } - } - else if (changeType == MPOS_SELECTLEFT) - { - if (m_subMenuChild) - m_subMenuChild->OnSelect(MPOS_CANCELLEVEL); - if (!m_subMenuParent) - return S_OK; return m_subMenuParent->OnSelect(MPOS_CANCELLEVEL); - } - else if (changeType == MPOS_SELECTRIGHT) - { + + case MPOS_SELECTRIGHT: if (m_hotBar && m_hotItem >= 0) { if (m_hotBar->PopupItem(m_hotItem) == S_OK) @@ -848,14 +871,14 @@ } if (!m_subMenuParent) return S_OK; - return m_subMenuParent->OnSelect(changeType); - } - else - { + return m_subMenuParent->OnSelect(MPOS_SELECTRIGHT); + + default: if (!m_subMenuParent) return S_OK; return m_subMenuParent->OnSelect(changeType); } + return S_OK; } @@ -868,8 +891,60 @@ return hr; } -HRESULT CMenuBand::_OnPopupSubMenu(IMenuPopup * popup, POINTL * pAt, RECTL * pExclude) -{ +HRESULT CMenuBand::_OnPopupSubMenu(IShellMenu * childShellMenu, POINTL * pAt, RECTL * pExclude) +{ + HRESULT hr = 0; + IBandSite* pBandSite; + IDeskBar* pDeskBar; + + // Create the necessary objects + +#if USE_SYSTEM_MENUSITE + hr = CoCreateInstance(CLSID_MenuBandSite, + NULL, + CLSCTX_INPROC_SERVER, + IID_PPV_ARG(IBandSite, &pBandSite)); +#else + hr = CMenuSite_Constructor(IID_PPV_ARG(IBandSite, &pBandSite)); +#endif + if (FAILED_UNEXPECTEDLY(hr)) + return hr; +#if WRAP_MENUSITE + hr = CMenuSite_Wrapper(pBandSite, IID_PPV_ARG(IBandSite, &pBandSite)); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; +#endif + +#if USE_SYSTEM_MENUDESKBAR + hr = CoCreateInstance(CLSID_MenuDeskBar, + NULL, + CLSCTX_INPROC_SERVER, + IID_PPV_ARG(IDeskBar, &pDeskBar)); +#else + hr = CMenuDeskBar_Constructor(IID_PPV_ARG(IDeskBar, &pDeskBar)); +#endif + if (FAILED_UNEXPECTEDLY(hr)) + return hr; +#if WRAP_MENUDESKBAR + hr = CMenuDeskBar_Wrapper(pDeskBar, IID_PPV_ARG(IDeskBar, &pDeskBar)); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; +#endif + + hr = pDeskBar->SetClient(pBandSite); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + hr = pBandSite->AddBand(childShellMenu); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + // + CComPtr<IMenuPopup> popup; + hr = pDeskBar->QueryInterface(IID_PPV_ARG(IMenuPopup, &popup)); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + m_subMenuChild = popup; if (m_subMenuParent) Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] Mon Apr 7 18:41:47 2014 @@ -175,13 +175,14 @@ HRESULT _CallCBWithItemId(UINT Id, UINT uMsg, WPARAM wParam, LPARAM lParam); HRESULT _CallCBWithItemPidl(LPITEMIDLIST pidl, UINT uMsg, WPARAM wParam, LPARAM lParam); - HRESULT _TrackSubMenuUsingTrackPopupMenu(HMENU popup, INT x, INT y, RECT& rcExclude); + HRESULT _TrackSubMenu(HMENU popup, INT x, INT y, RECT& rcExclude); + HRESULT _TrackContextMenu(IContextMenu * popup, INT x, INT y); HRESULT _GetTopLevelWindow(HWND*topLevel); HRESULT _ChangeHotItem(CMenuToolbarBase * tb, INT id, DWORD dwFlags); HRESULT _ChangePopupItem(CMenuToolbarBase * tb, INT id); HRESULT _MenuItemHotTrack(DWORD changeType); HRESULT _CancelCurrentPopup(); - HRESULT _OnPopupSubMenu(IMenuPopup * popup, POINTL * pAt, RECTL * pExclude); + HRESULT _OnPopupSubMenu(IShellMenu * childShellMenu, POINTL * pAt, RECTL * pExclude); HRESULT _DisableMouseTrack(BOOL bDisable); HRESULT _SetChildBand(CMenuBand * child); HRESULT _SetParentBand(CMenuBand * parent); @@ -195,5 +196,6 @@ } private: + HRESULT _KeyboardItemChange(DWORD change); HRESULT _CallCB(UINT uMsg, WPARAM wParam, LPARAM lParam, UINT id = 0, LPITEMIDLIST pidl = NULL); }; Modified: branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] Mon Apr 7 18:41:47 2014 @@ -261,7 +261,7 @@ // Don't do anything if another window is capturing the mouse. HWND cCapture = ::GetCapture(); - if (cCapture && cCapture != m_captureHwnd) + if (cCapture && cCapture != m_captureHwnd && m_current->type != TrackedMenuEntry) return TRUE; m_ptPrev = pt; @@ -283,7 +283,8 @@ { m_entryUnderMouse->mb->_ChangeHotItem(NULL, -1, HICF_MOUSE); } - SetCapture(NULL); + if (cCapture == m_captureHwnd) + SetCapture(NULL); } } @@ -303,7 +304,8 @@ if (m_current->type == TrackedMenuEntry) SendMessage(entry->hwnd, WM_CANCELMODE, 0, 0); PostMessage(child, WM_USER_CHANGETRACKEDITEM, iHitTestResult, isTracking); - return FALSE; + if (m_current->type == TrackedMenuEntry) + return FALSE; } } @@ -311,10 +313,10 @@ { if (entry) { - SetCapture(child); - if (m_current->type == MenuPopupEntry) { + //SetCapture(child); + ScreenToClient(child, &pt2); SendMessage(child, WM_MOUSEMOVE, msg->wParam, MAKELPARAM(pt2.x, pt2.y)); } @@ -399,6 +401,10 @@ case WM_MOUSEMOVE: callNext = ProcessMouseMove(msg); break; + case WM_MOUSELEAVE: + callNext = ProcessMouseMove(msg); + //callNext = ProcessMouseLeave(msg); + break; case WM_SYSKEYDOWN: case WM_KEYDOWN: if (m_current->type == MenuPopupEntry) @@ -406,16 +412,17 @@ DisableMouseTrack(m_current->hwnd, TRUE); switch (msg->wParam) { + case VK_ESCAPE: case VK_MENU: case VK_LMENU: case VK_RMENU: m_current->mb->_MenuItemHotTrack(MPOS_FULLCANCEL); break; case VK_LEFT: - m_current->mb->_MenuItemHotTrack(MPOS_SELECTLEFT); + m_current->mb->_MenuItemHotTrack(VK_LEFT); break; case VK_RIGHT: - m_current->mb->_MenuItemHotTrack(MPOS_SELECTRIGHT); + m_current->mb->_MenuItemHotTrack(VK_RIGHT); break; case VK_UP: m_current->mb->_MenuItemHotTrack(VK_UP); Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Mon Apr 7 18:41:47 2014 @@ -159,7 +159,7 @@ HRESULT CMenuToolbarBase::OnPagerCalcSize(LPNMPGCALCSIZE csize) { SIZE tbs; - GetIdealSize(tbs); + GetSizes(NULL, &tbs, NULL); if (csize->dwFlag == PGF_CALCHEIGHT) { csize->iHeight = tbs.cy; @@ -284,12 +284,16 @@ m_menuBand(menuBand), m_hwndToolbar(NULL), m_dwMenuFlags(0), - m_hasIdealSize(FALSE), + m_hasSizes(FALSE), m_usePager(usePager), m_hotItem(-1), m_popupItem(-1), - m_isTracking(FALSE) -{ + m_isTrackingPopup(FALSE) +{ + m_idealSize.cx = 0; + m_idealSize.cy = 0; + m_itemSize.cx = 0; + m_itemSize.cy = 0; m_marlett = CreateFont( 0, 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, @@ -452,18 +456,38 @@ return S_OK; } -HRESULT CMenuToolbarBase::GetIdealSize(SIZE& size) -{ - size.cx = size.cy = 0; - - if (m_hwndToolbar && !m_hasIdealSize) - { - SendMessageW(m_hwndToolbar, TB_AUTOSIZE, 0, 0); - SendMessageW(m_hwndToolbar, TB_GETMAXSIZE, 0, reinterpret_cast<LPARAM>(&m_idealSize)); - m_hasIdealSize = TRUE; - } - - size = m_idealSize; +HRESULT CMenuToolbarBase::GetSizes(SIZE* pMinSize, SIZE* pMaxSize, SIZE* pIntegralSize) +{ + if (pMinSize) + *pMinSize = m_idealSize; + if (pMaxSize) + *pMaxSize = m_idealSize; + if (pIntegralSize) + *pIntegralSize = m_itemSize; + + if (m_hasSizes) + return S_OK; + + if (!m_hwndToolbar) + return S_OK; + + // Obtain the ideal size, to be used as min and max + SendMessageW(m_hwndToolbar, TB_AUTOSIZE, 0, 0); + SendMessageW(m_hwndToolbar, TB_GETMAXSIZE, 0, reinterpret_cast<LPARAM>(&m_idealSize)); + SendMessageW(m_hwndToolbar, TB_GETIDEALSIZE, (m_initFlags & SMINIT_VERTICAL) != 0, reinterpret_cast<LPARAM>(&m_idealSize)); + + // Obtain the button size, to be used as the integral size + DWORD size = SendMessageW(m_hwndToolbar, TB_GETBUTTONSIZE, 0, 0); + m_itemSize.cx = GET_X_LPARAM(size); + m_itemSize.cy = GET_Y_LPARAM(size); + m_hasSizes = TRUE; + + if (pMinSize) + *pMinSize = m_idealSize; + if (pMaxSize) + *pMaxSize = m_idealSize; + if (pIntegralSize) + *pIntegralSize = m_itemSize; return S_OK; } @@ -560,46 +584,21 @@ return S_FALSE; } -HRESULT CMenuToolbarBase::OnHotItemChange(const NMTBHOTITEM * hot, LRESULT * theResult) -{ +HRESULT CMenuToolbarBase::ChangeHotItem(CMenuToolbarBase * toolbar, INT item, DWORD dwFlags) +{ + // Ignore the change if it already matches the stored info + if (m_hotBar == toolbar && m_hotItem == item) + return S_FALSE; + // Prevent a change of hot item if the change was triggered by the mouse, // and mouse tracking is disabled. - if (m_disableMouseTrack && hot->dwFlags & HICF_MOUSE) - { - *theResult = 1; + if (m_disableMouseTrack && dwFlags & HICF_MOUSE) + { DbgPrint("Hot item change prevented by DisableMouseTrack\n"); return S_OK; } - HRESULT hr = S_OK; - if (hot->dwFlags & HICF_LEAVING) - { - // Only notify of LEAVING if this was the hot toolbar. - if (m_hotBar == this) - { - DbgPrint("The hot bar is now cold.\n"); - hr = m_menuBand->_ChangeHotItem(NULL, -1, hot->dwFlags); - } - } - else - { - hr = m_menuBand->_ChangeHotItem(this, hot->idNew, hot->dwFlags); - } - - if (FAILED_UNEXPECTEDLY(hr)) - return hr; - - // Reuse S_OK/S_FALSE as Continue/Cancel - *theResult = hr; - - return S_OK; -} - -HRESULT CMenuToolbarBase::ChangeHotItem(CMenuToolbarBase * toolbar, INT item, DWORD dwFlags) -{ - if (m_hotBar == toolbar && m_hotItem == item) - return S_FALSE; - + // Notify the toolbar if the hot-tracking left this toolbar if (m_hotBar == this && toolbar != this) { SendMessage(m_hwndToolbar, TB_SETHOTITEM, (WPARAM)-1, 0); @@ -623,8 +622,9 @@ m_timerEnabled = TRUE; DbgPrint("SetTimer called with m_hotItem=%d\n", m_hotItem); } - else if (m_isTracking) + else if (m_isTrackingPopup) { + // If the menubar has an open submenu, switch to the new item's submenu immediately PopupItem(m_hotItem); } } @@ -646,13 +646,15 @@ HRESULT CMenuToolbarBase::ChangePopupItem(CMenuToolbarBase * toolbar, INT item) { + // Ignore the change if it already matches the stored info if (m_popupBar == toolbar && m_popupItem == item) return S_FALSE; + // Notify the toolbar if the popup-tracking this toolbar if (m_popupBar == this && toolbar != this) { SendMessage(m_hwndToolbar, TB_CHECKBUTTON, m_popupItem, FALSE); - m_isTracking = FALSE; + m_isTrackingPopup = FALSE; } m_popupBar = toolbar; @@ -693,7 +695,7 @@ return E_FAIL; DbgPrint("Changing tracked item to %d...\n", index); - m_isTracking = wasTracking; + m_isTrackingPopup = wasTracking; m_menuBand->_ChangeHotItem(this, btn.idCommand, HICF_MOUSE); return S_OK; @@ -701,10 +703,7 @@ HRESULT CMenuToolbarBase::PopupSubMenu(UINT iItem, UINT index, IShellMenu* childShellMenu) { - IBandSite* pBandSite; - IDeskBar* pDeskBar; - - HRESULT hr = 0; + // Calculate the submenu position and exclude area RECT rc = { 0 }; RECT rcx = { 0 }; @@ -732,81 +731,31 @@ pt.y = a.y - 3; } -#if USE_SYSTEM_MENUSITE - hr = CoCreateInstance(CLSID_MenuBandSite, - NULL, - CLSCTX_INPROC_SERVER, - IID_PPV_ARG(IBandSite, &pBandSite)); -#else - hr = CMenuSite_Constructor(IID_PPV_ARG(IBandSite, &pBandSite)); -#endif - if (FAILED_UNEXPECTEDLY(hr)) - return hr; -#if WRAP_MENUSITE - hr = CMenuSite_Wrapper(pBandSite, IID_PPV_ARG(IBandSite, &pBandSite)); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; -#endif - -#if USE_SYSTEM_MENUDESKBAR - hr = CoCreateInstance(CLSID_MenuDeskBar, - NULL, - CLSCTX_INPROC_SERVER, - IID_PPV_ARG(IDeskBar, &pDeskBar)); -#else - hr = CMenuDeskBar_Constructor(IID_PPV_ARG(IDeskBar, &pDeskBar)); -#endif - if (FAILED_UNEXPECTEDLY(hr)) - return hr; -#if WRAP_MENUDESKBAR - hr = CMenuDeskBar_Wrapper(pDeskBar, IID_PPV_ARG(IDeskBar, &pDeskBar)); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; -#endif - - hr = pDeskBar->SetClient(pBandSite); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; - - hr = pBandSite->AddBand(childShellMenu); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; - - CComPtr<IMenuPopup> popup; - hr = pDeskBar->QueryInterface(IID_PPV_ARG(IMenuPopup, &popup)); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; - - m_isTracking = TRUE; + // Display the submenu + m_isTrackingPopup = TRUE; m_menuBand->_ChangePopupItem(this, iItem); - m_menuBand->_OnPopupSubMenu(popup, &pt, &rcl); + m_menuBand->_OnPopupSubMenu(childShellMenu, &pt, &rcl); return S_OK; } HRESULT CMenuToolbarBase::PopupSubMenu(UINT iItem, UINT index, HMENU menu) { + // Calculate the submenu position and exclude area RECT rc = { 0 }; - RECT rcx = { 0 }; if (!SendMessage(m_hwndToolbar, TB_GETITEMRECT, index, reinterpret_cast<LPARAM>(&rc))) return E_FAIL; - - GetClientRect(m_hwndToolbar, &rcx); - + POINT a = { rc.left, rc.top }; POINT b = { rc.right, rc.bottom }; - POINT c = { rc.left, rc.top }; - POINT d = { rc.right, rc.bottom }; ClientToScreen(m_hwndToolbar, &a); ClientToScreen(m_hwndToolbar, &b); - ClientToScreen(m_hwndToolbar, &c); - ClientToScreen(m_hwndToolbar, &d); POINT pt = { a.x, b.y }; - RECT rcl = { c.x, c.y, d.x, d.y }; + RECT rcl = { a.x, a.y, b.x, b.y }; if (m_initFlags & SMINIT_VERTICAL) { @@ -816,45 +765,24 @@ HMENU popup = GetSubMenu(menu, index); - m_isTracking = TRUE; - + // Display the submenu + m_isTrackingPopup = TRUE; m_menuBand->_ChangePopupItem(this, iItem); - m_menuBand->_TrackSubMenuUsingTrackPopupMenu(popup, pt.x, pt.y, rcl); + m_menuBand->_TrackSubMenu(popup, pt.x, pt.y, rcl); m_menuBand->_ChangePopupItem(NULL, -1); - - m_isTracking = FALSE; + m_isTrackingPopup = FALSE; return S_OK; } HRESULT CMenuToolbarBase::DoContextMenu(IContextMenu* contextMenu) { - HRESULT hr; - HMENU hPopup = CreatePopupMenu(); - - if (hPopup == NULL) - return E_FAIL; - - hr = contextMenu->QueryContextMenu(hPopup, 0, 0, UINT_MAX, CMF_NORMAL); - if (FAILED_UNEXPECTEDLY(hr)) - { - DestroyMenu(hPopup); - return hr; - } - + // Calculate the context menu position DWORD dwPos = GetMessagePos(); - UINT uCommand = ::TrackPopupMenu(hPopup, TPM_RETURNCMD, GET_X_LPARAM(dwPos), GET_Y_LPARAM(dwPos), 0, m_hwnd, NULL); - if (uCommand == 0) - return S_FALSE; - - CMINVOKECOMMANDINFO cmi = { 0 }; - cmi.cbSize = sizeof(cmi); - cmi.lpVerb = MAKEINTRESOURCEA(uCommand); - cmi.hwnd = m_hwnd; - hr = contextMenu->InvokeCommand(&cmi); - - DestroyMenu(hPopup); - return hr; + POINT pt = { GET_X_LPARAM(dwPos), GET_Y_LPARAM(dwPos) }; + + // Display the submenu + return m_menuBand->_TrackContextMenu(contextMenu, pt.x, pt.y); } HRESULT CMenuToolbarBase::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult) @@ -866,6 +794,13 @@ return S_OK; } + // If a button is clicked while a submenu was open, cancel the submenu. + if (!(m_initFlags & SMINIT_VERTICAL) && m_isTrackingPopup) + { + DbgPrint("OnCommand cancelled because it was tracking submenu.\n"); + return S_FALSE; + } + *theResult = 0; m_menuBand->_KillPopupTimers(); @@ -883,7 +818,7 @@ if (FAILED_UNEXPECTEDLY(hr)) return hr; - return S_OK; // filter out a possible S_FALSE from here. + return OnCommandInternal(wParam, lParam, theResult); } HRESULT CMenuToolbarBase::KeyboardItemChange(DWORD dwSelectType) @@ -948,7 +883,7 @@ if (prev != btn.idCommand) { DbgPrint("Setting Hot item to %d\n", index); - SendMessage(m_hwndToolbar, TB_SETHOTITEM, index, 0); + m_menuBand->_ChangeHotItem(this, index, 0); } return S_OK; } @@ -967,8 +902,9 @@ if (prev != -1) { DbgPrint("Setting Hot item to null\n"); - SendMessage(m_hwndToolbar, TB_SETHOTITEM, (WPARAM) -1, 0); - } + m_menuBand->_ChangeHotItem(NULL, -1, 0); + } + return S_FALSE; } @@ -1219,25 +1155,8 @@ return DoContextMenu(contextMenu); } -HRESULT CMenuStaticToolbar::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult) -{ - HRESULT hr; - - if (m_isTracking) - { - return S_FALSE; - } - - hr = CMenuToolbarBase::OnCommand(wParam, lParam, theResult); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; - - // in case the clicked item has a submenu, we do not need to execute the item - if (hr == S_FALSE) - { - return hr; - } - +HRESULT CMenuStaticToolbar::OnCommandInternal(WPARAM wParam, LPARAM lParam, LRESULT *theResult) +{ return m_menuBand->_CallCBWithItemId(wParam, SMC_EXEC, 0, 0); } @@ -1313,7 +1232,6 @@ hr = m_shellFolder->GetAttributesOf(1, &itemc, &attrs); DWORD_PTR dwData = reinterpret_cast<DWORD_PTR>(ILClone(item)); - // FIXME: remove before deleting the toolbar or it will leak // Fetch next item already, so we know if the current one is the last hr = eidl->Next(1, &item, &fetched); @@ -1399,21 +1317,10 @@ return DoContextMenu(contextMenu); } -HRESULT CMenuSFToolbar::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult) -{ - HRESULT hr; - hr = CMenuToolbarBase::OnCommand(wParam, lParam, theResult); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; - - // in case the clicked item has a submenu, we do not need to execute the item - if (hr == S_FALSE) - { - DbgPrint("CMenuToolbarBase::OnCommand told us to cancel.\n"); - return hr; - } - +HRESULT CMenuSFToolbar::OnCommandInternal(WPARAM wParam, LPARAM lParam, LRESULT *theResult) +{ DWORD_PTR data; + GetDataFromId(wParam, NULL, &data); return m_menuBand->_CallCBWithItemPidl(reinterpret_cast<LPITEMIDLIST>(data), SMC_SFEXEC, 0, 0); Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] Mon Apr 7 18:41:47 2014 @@ -40,8 +40,9 @@ CMenuBand * m_menuBand; HWND m_hwndToolbar; DWORD m_dwMenuFlags; - BOOL m_hasIdealSize; + BOOL m_hasSizes; SIZE m_idealSize; + SIZE m_itemSize; BOOL m_usePager; CMenuToolbarBase * m_hotBar; INT m_hotItem; @@ -49,7 +50,7 @@ INT m_popupItem; DWORD m_initFlags; - BOOL m_isTracking; + BOOL m_isTrackingPopup; private: static LRESULT CALLBACK s_SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); @@ -74,12 +75,11 @@ HRESULT DoContextMenu(IContextMenu* contextMenu); HRESULT KeyboardItemChange(DWORD changeType); - HRESULT OnHotItemChange(const NMTBHOTITEM * hot, LRESULT * theResult); HRESULT IsTrackedItem(INT index); HRESULT ChangeTrackedItem(INT index, BOOL wasTracking); - HRESULT GetIdealSize(SIZE& size); + HRESULT GetSizes(SIZE* pMinSize, SIZE* pMaxSize, SIZE* pIntegralSize); HRESULT SetPosSize(int x, int y, int cx, int cy); void InvalidateDraw(); @@ -96,7 +96,7 @@ HRESULT KillPopupTimer(); protected: - virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult); + virtual HRESULT OnCommandInternal(WPARAM wParam, LPARAM lParam, LRESULT *theResult) = 0; virtual HRESULT OnDeletingButton(const NMTOOLBAR * tb) = 0; virtual HRESULT InternalPopupItem(INT iItem, INT index, DWORD_PTR dwData) = 0; @@ -113,6 +113,7 @@ HRESULT UpdateImageLists(); private: + HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult); HRESULT OnPagerCalcSize(LPNMPGCALCSIZE csize); HRESULT OnPopupTimer(DWORD timerId); HRESULT OnCustomDraw(LPNMTBCUSTOMDRAW cdraw, LRESULT * theResult); @@ -133,7 +134,7 @@ HRESULT GetMenu(HMENU *phmenu, HWND *phwnd, DWORD *pdwFlags); virtual HRESULT FillToolbar(BOOL clearFirst=FALSE); - virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult); + virtual HRESULT OnCommandInternal(WPARAM wParam, LPARAM lParam, LRESULT *theResult); virtual HRESULT OnContextMenu(NMMOUSE * rclick); protected: @@ -161,7 +162,7 @@ HRESULT GetShellFolder(DWORD *pdwFlags, LPITEMIDLIST *ppidl, REFIID riid, void **ppv); virtual HRESULT FillToolbar(BOOL clearFirst=FALSE); - virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult); + virtual HRESULT OnCommandInternal(WPARAM wParam, LPARAM lParam, LRESULT *theResult); virtual HRESULT OnContextMenu(NMMOUSE * rclick); protected:
10 years, 8 months
1
0
0
0
[dquintana] 62680: [RSHELL] * Some small fixes to the previous commit. (Clicking still do not work in win2003, though)
by dquintana@svn.reactos.org
Author: dquintana Date: Mon Apr 7 10:12:41 2014 New Revision: 62680 URL:
http://svn.reactos.org/svn/reactos?rev=62680&view=rev
Log: [RSHELL] * Some small fixes to the previous commit. (Clicking still do not work in win2003, though) Modified: branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp branches/shell-experiments/base/shell/rshell/precomp.h Modified: branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] Mon Apr 7 10:12:41 2014 @@ -300,37 +300,32 @@ rc.right += bm.bmWidth; } - int x, y, cx, cy; - RECT rcWorkArea; GetWindowRect(GetDesktopWindow(), &rcWorkArea); int waHeight = rcWorkArea.bottom - rcWorkArea.top; + int x = ppt->x; + int y = ppt->y; + int cx = rc.right - rc.left; + int cy = rc.bottom - rc.top; + switch (dwFlags & 0xFF000000) { case MPPF_BOTTOM: x = ppt->x; - cx = rc.right - rc.left; y = ppt->y - rc.bottom; - cy = rc.bottom - rc.top; break; case MPPF_RIGHT: x = ppt->x + rc.left; - cx = rc.right - rc.left; y = ppt->y + rc.top; - cy = rc.bottom - rc.top; break; case MPPF_TOP | MPPF_ALIGN_LEFT: x = ppt->x - rc.right; - cx = rc.right - rc.left; y = ppt->y + rc.top; - cy = rc.bottom - rc.top; break; case MPPF_TOP | MPPF_ALIGN_RIGHT: x = ppt->x; - cx = rc.right - rc.left; y = ppt->y + rc.top; - cy = rc.bottom - rc.top; break; } Modified: branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] Mon Apr 7 10:12:41 2014 @@ -254,9 +254,14 @@ POINT pt2 = { GET_X_LPARAM(msg->lParam), GET_Y_LPARAM(msg->lParam) }; ClientToScreen(msg->hwnd, &pt2); - /* Don't do anything if the mouse has not been moved */ + // Don't do anything if the mouse has not been moved POINT pt = msg->pt; if (pt.x == m_ptPrev.x && pt.y == m_ptPrev.y) + return TRUE; + + // Don't do anything if another window is capturing the mouse. + HWND cCapture = ::GetCapture(); + if (cCapture && cCapture != m_captureHwnd) return TRUE; m_ptPrev = pt; Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Mon Apr 7 10:12:41 2014 @@ -602,7 +602,7 @@ if (m_hotBar == this && toolbar != this) { - SendMessage(m_hwndToolbar, TB_SETHOTITEM, -1, 0); + SendMessage(m_hwndToolbar, TB_SETHOTITEM, (WPARAM)-1, 0); } m_hotBar = toolbar; @@ -967,7 +967,7 @@ if (prev != -1) { DbgPrint("Setting Hot item to null\n"); - SendMessage(m_hwndToolbar, TB_SETHOTITEM, -1, 0); + SendMessage(m_hwndToolbar, TB_SETHOTITEM, (WPARAM) -1, 0); } return S_FALSE; } Modified: branches/shell-experiments/base/shell/rshell/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] Mon Apr 7 10:12:41 2014 @@ -1,3 +1,21 @@ + +#ifdef _MSC_VER + +// Disabling spammy warnings when compiling with /W4 or /Wall +#pragma warning(disable:4100) // unreferenced formal parameter +#pragma warning(disable:4201) // nonstandard extension used +#pragma warning(disable:4265) // class has virtual functions, but destructor is not virtual +#pragma warning(disable:4365) // signed/unsigned mismatch +#pragma warning(disable:4514) // unreferenced inline function +#pragma warning(disable:4710) // function was not inlined +#pragma warning(disable:4820) // padding added +#pragma warning(disable:4946) // reinterpret_cast between related classes + +// Disable some warnings in headers only +#pragma warning(push) +#pragma warning(disable:4244) // possible loss of data +#pragma warning(disable:4512) // assignment operator could not be gernerated +#endif #define USE_SYSTEM_MENUDESKBAR 0 #define USE_SYSTEM_MENUSITE 0 @@ -37,10 +55,14 @@ #include <atlcom.h> #include <wine/debug.h> +#if _MSC_VER +// Restore warnings +#pragma warning(pop) +#endif + #define shell32_hInstance 0 #define SMC_EXEC 4 extern "C" INT WINAPI Shell_GetCachedImageIndex(LPCWSTR szPath, INT nIndex, UINT bSimulateDoc); - extern "C" HRESULT WINAPI CStartMenu_Constructor(REFIID riid, void **ppv); extern "C" HRESULT WINAPI CMenuDeskBar_Constructor(REFIID riid, LPVOID *ppv);
10 years, 8 months
1
0
0
0
[jimtabor] 62679: - Fix win tests. WIP see r62613.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Apr 7 02:29:03 2014 New Revision: 62679 URL:
http://svn.reactos.org/svn/reactos?rev=62679&view=rev
Log: - Fix win tests. WIP see r62613. Modified: trunk/reactos/win32ss/user/ntuser/window.c Modified: trunk/reactos/win32ss/user/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/window…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] Mon Apr 7 02:29:03 2014 @@ -1760,7 +1760,8 @@ if (!(Cs->dwExStyle & WS_EX_LAYOUTRTL)) { // Need both here for wine win.c test_CreateWindow. - if (Cs->hwndParent && ParentWindow) + //if (Cs->hwndParent && ParentWindow) + if (ParentWindow) // It breaks more tests..... WIP. { if ( (Cs->style & (WS_CHILD|WS_POPUP)) == WS_CHILD && ParentWindow->ExStyle & WS_EX_LAYOUTRTL &&
10 years, 8 months
1
0
0
0
[pschweitzer] 62678: [FTFD] Fix memory leak CID #1102396
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Apr 6 21:35:21 2014 New Revision: 62678 URL:
http://svn.reactos.org/svn/reactos?rev=62678&view=rev
Log: [FTFD] Fix memory leak CID #1102396 Modified: trunk/reactos/win32ss/drivers/font/ftfd/font.c Modified: trunk/reactos/win32ss/drivers/font/ftfd/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/drivers/font/ftfd/…
============================================================================== --- trunk/reactos/win32ss/drivers/font/ftfd/font.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/drivers/font/ftfd/font.c [iso-8859-1] Sun Apr 6 21:35:21 2014 @@ -420,6 +420,7 @@ if (!pGlyphSet) { DbgPrint("EngAllocMem() failed.\n"); + EngFreeMem(pcp); return NULL; }
10 years, 8 months
1
0
0
0
← Newer
1
...
38
39
40
41
42
43
44
...
50
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Results per page:
10
25
50
100
200