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
November 2016
----- 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
317 discussions
Start a n
N
ew thread
[mjansen] 73410: This does not belong here.
by mjansen@svn.reactos.org
Author: mjansen Date: Wed Nov 30 20:39:06 2016 New Revision: 73410 URL:
http://svn.reactos.org/svn/reactos?rev=73410&view=rev
Log: This does not belong here. Modified: trunk/rostests/apitests/netshell/testlist.c Modified: trunk/rostests/apitests/netshell/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/netshell/testlis…
============================================================================== --- trunk/rostests/apitests/netshell/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/netshell/testlist.c [iso-8859-1] Wed Nov 30 20:39:06 2016 @@ -1,5 +1,4 @@ #define STANDALONE -#include "R:\hook\base_hk.h" #include <apitest.h> extern void func_isvalidname(void);
8 years
1
0
0
0
[mjansen] 73409: [NETSHELL] Implement NcIsValidConnectionName + tests. Patch by Jared Smudde, modified by me. CORE-11320 #resolve
by mjansen@svn.reactos.org
Author: mjansen Date: Wed Nov 30 20:31:50 2016 New Revision: 73409 URL:
http://svn.reactos.org/svn/reactos?rev=73409&view=rev
Log: [NETSHELL] Implement NcIsValidConnectionName + tests. Patch by Jared Smudde, modified by me. CORE-11320 #resolve Added: trunk/rostests/apitests/netshell/ trunk/rostests/apitests/netshell/CMakeLists.txt (with props) trunk/rostests/apitests/netshell/NcIsValidConnectionName.c (with props) trunk/rostests/apitests/netshell/testlist.c (with props) Modified: trunk/reactos/dll/shellext/netshell/netshell.cpp trunk/reactos/dll/shellext/netshell/netshell.spec trunk/rostests/apitests/CMakeLists.txt Modified: trunk/reactos/dll/shellext/netshell/netshell.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/netshell/nets…
============================================================================== --- trunk/reactos/dll/shellext/netshell/netshell.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/shellext/netshell/netshell.cpp [iso-8859-1] Wed Nov 30 20:31:50 2016 @@ -70,4 +70,37 @@ CoTaskMemFree(pProps); } +BOOL +WINAPI +NcIsValidConnectionName(_In_ PCWSTR pszwName) +{ + if (!pszwName) + return FALSE; + + BOOL nonSpace = FALSE; + while (*pszwName) + { + switch(*(pszwName++)) + { + case L'\\': + case L'/': + case L':': + case L'*': + case L'\t': + case L'?': + case L'<': + case L'>': + case L'|': + case L'\"': + return FALSE; + case L' ': + break; + default: + nonSpace = TRUE; + break; + } + } + return nonSpace; +} + } // extern "C" Modified: trunk/reactos/dll/shellext/netshell/netshell.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/netshell/nets…
============================================================================== --- trunk/reactos/dll/shellext/netshell/netshell.spec [iso-8859-1] (original) +++ trunk/reactos/dll/shellext/netshell/netshell.spec [iso-8859-1] Wed Nov 30 20:31:50 2016 @@ -21,7 +21,7 @@ 20 stub HrRunWizard 21 stub InvokeDunFile 22 stdcall NcFreeNetconProperties(ptr) -23 stub NcIsValidConnectionName +23 stdcall NcIsValidConnectionName(wstr) 24 stub NetSetupAddRasConnection 25 stub NetSetupFinishInstall 26 stub NetSetupInstallSoftware Modified: trunk/rostests/apitests/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/CMakeLists.txt?r…
============================================================================== --- trunk/rostests/apitests/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/CMakeLists.txt [iso-8859-1] Wed Nov 30 20:31:50 2016 @@ -18,6 +18,7 @@ add_subdirectory(localspl) add_subdirectory(msgina) add_subdirectory(msvcrt) +add_subdirectory(netshell) add_subdirectory(ntdll) add_subdirectory(ole32) add_subdirectory(pefile) Added: trunk/rostests/apitests/netshell/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/netshell/CMakeLi…
============================================================================== --- trunk/rostests/apitests/netshell/CMakeLists.txt (added) +++ trunk/rostests/apitests/netshell/CMakeLists.txt [iso-8859-1] Wed Nov 30 20:31:50 2016 @@ -0,0 +1,5 @@ + +add_executable(netshell_apitest NcIsValidConnectionName.c testlist.c) +set_module_type(netshell_apitest win32cui) +add_importlibs(netshell_apitest msvcrt kernel32) +add_cd_file(TARGET netshell_apitest DESTINATION reactos/bin FOR all) Propchange: trunk/rostests/apitests/netshell/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/apitests/netshell/NcIsValidConnectionName.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/netshell/NcIsVal…
============================================================================== --- trunk/rostests/apitests/netshell/NcIsValidConnectionName.c (added) +++ trunk/rostests/apitests/netshell/NcIsValidConnectionName.c [iso-8859-1] Wed Nov 30 20:31:50 2016 @@ -0,0 +1,121 @@ +/* + * Copyright 2016 Jared Smudde + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* Documentation:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa366197%28v=vs.85…
*/ + +#include <apitest.h> + +static BOOL (WINAPI *pNcIsValidConnectionName)(PCWSTR); + +#define CALL_NC(exp, str) \ + do { \ + BOOL ret = pNcIsValidConnectionName((str)); \ + ok(ret == (exp), "Expected %s to be %d, was %d\n", wine_dbgstr_w((str)), (exp), ret); \ + } while (0) + + + +static void test_BadLetters(void) +{ + BOOL ret; + + WCHAR buf[3] = { 0 }; + int i; + + for (i = 1; i <= 0xFFFF; ++i) + { + buf[0] = (WCHAR)i; + buf[1] = buf[2] = L'\0'; + + if (wcspbrk(buf, L"\\/:\t*? <>|\"") != NULL) + { + ret = pNcIsValidConnectionName(buf); + ok(ret == FALSE, "Expected %s (%i) to fail.\n", wine_dbgstr_w(buf), i); + + /* How about two of a kind? */ + buf[1] = (WCHAR)i; + ret = pNcIsValidConnectionName(buf); + ok(ret == FALSE, "Expected %s (%i) to fail.\n", wine_dbgstr_w(buf), i); + + /* And something (bad) combined with a space? */ + buf[1] = L' '; + ret = pNcIsValidConnectionName(buf); + ok(ret == FALSE, "Expected %s (%i) to fail.\n", wine_dbgstr_w(buf), i); + + + /* Something bad combined with a letter */ + buf[1] = L'a'; + ret = pNcIsValidConnectionName(buf); + if ((WCHAR)i == L' ') + ok(ret == TRUE, "Expected %s (%i) to succeed.\n", wine_dbgstr_w(buf), i); + else + ok(ret == FALSE, "Expected %s (%i) to fail.\n", wine_dbgstr_w(buf), i); + } + else + { + ret = pNcIsValidConnectionName(buf); + ok(ret == TRUE, "Expected %s (%i) to succeed.\n", wine_dbgstr_w(buf), i); + + buf[1] = (WCHAR)i; + ret = pNcIsValidConnectionName(buf); + ok(ret == TRUE, "Expected %s (%i) to succeed.\n", wine_dbgstr_w(buf), i); + + buf[1] = L'a'; + ret = pNcIsValidConnectionName(buf); + ok(ret == TRUE, "Expected %s (%i) to succeed.\n", wine_dbgstr_w(buf), i); + + buf[1] = L' '; + ret = pNcIsValidConnectionName(buf); + ok(ret == TRUE, "Expected %s (%i) to succeed.\n", wine_dbgstr_w(buf), i); + } + } +} + +START_TEST(isvalidname) +{ + HMODULE hDll = LoadLibraryA("netshell.dll"); + + pNcIsValidConnectionName = (void*)GetProcAddress(hDll, "NcIsValidConnectionName"); + if (!hDll || !pNcIsValidConnectionName) + { + skip("netshell.dll or export NcIsValidConnectionName not found! Tests will be skipped\n"); + return; + } + + CALL_NC(TRUE, L"Network"); + CALL_NC(FALSE, L"Network?"); + + CALL_NC(FALSE, L"\\"); + CALL_NC(FALSE, L"/"); + CALL_NC(FALSE, L":"); + CALL_NC(FALSE, L"*"); + CALL_NC(FALSE, L"?"); + CALL_NC(FALSE, L"<"); + CALL_NC(FALSE, L">"); + CALL_NC(FALSE, L"|"); + + CALL_NC(FALSE, NULL); + + CALL_NC(TRUE, L"Wireless"); + CALL_NC(FALSE, L"Wireless:1"); + CALL_NC(TRUE, L"Intranet"); + CALL_NC(FALSE, L"Intranet<"); + CALL_NC(TRUE, L"Network Connection"); + + test_BadLetters(); +} Propchange: trunk/rostests/apitests/netshell/NcIsValidConnectionName.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/apitests/netshell/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/netshell/testlis…
============================================================================== --- trunk/rostests/apitests/netshell/testlist.c (added) +++ trunk/rostests/apitests/netshell/testlist.c [iso-8859-1] Wed Nov 30 20:31:50 2016 @@ -0,0 +1,11 @@ +#define STANDALONE +#include "R:\hook\base_hk.h" +#include <apitest.h> + +extern void func_isvalidname(void); + +const struct test winetest_testlist[] = +{ + { "NcIsValidConnectionName", func_isvalidname }, + { 0, 0 } +}; Propchange: trunk/rostests/apitests/netshell/testlist.c ------------------------------------------------------------------------------ svn:eol-style = native
8 years
1
0
0
0
[gadamopoulos] 73408: Fix build.
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Tue Nov 29 18:01:35 2016 New Revision: 73408 URL:
http://svn.reactos.org/svn/reactos?rev=73408&view=rev
Log: Fix build. Modified: trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp Modified: trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefView…
============================================================================== --- trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp [iso-8859-1] Tue Nov 29 18:01:35 2016 @@ -172,7 +172,7 @@ { InsertMenuA(hMenu, indexMenu++, MF_BYPOSITION | MF_SEPARATOR, 0, NULL); UINT SeparatorIndex = indexMenu; - UINT count = GetMenuItemCount(hMenu); + int count = GetMenuItemCount(hMenu); hr = m_folderCM->QueryContextMenu(hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags); if (SUCCEEDED(hr))
8 years
1
0
0
0
[gadamopoulos] 73407: [SHELL32] - CDefViewBckgrndMenu: Shell_MergeMenus doesn't handle items added by shell extensions correctly so let the folder IContextMenu add its items directly in the menu. C...
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Tue Nov 29 17:56:04 2016 New Revision: 73407 URL:
http://svn.reactos.org/svn/reactos?rev=73407&view=rev
Log: [SHELL32] - CDefViewBckgrndMenu: Shell_MergeMenus doesn't handle items added by shell extensions correctly so let the folder IContextMenu add its items directly in the menu. CORE-12508 Modified: trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp Modified: trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefView…
============================================================================== --- trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp [iso-8859-1] Tue Nov 29 17:56:04 2016 @@ -170,16 +170,25 @@ hr = m_psf->CreateViewObject(NULL, IID_PPV_ARG(IContextMenu, &m_folderCM)); if (SUCCEEDED(hr)) { - hr = m_folderCM->QueryContextMenu(hMenuPart, 0, idCmdFirst, idCmdLast, uFlags); + InsertMenuA(hMenu, indexMenu++, MF_BYPOSITION | MF_SEPARATOR, 0, NULL); + UINT SeparatorIndex = indexMenu; + UINT count = GetMenuItemCount(hMenu); + + hr = m_folderCM->QueryContextMenu(hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags); if (SUCCEEDED(hr)) { - Shell_MergeMenus(hMenu, hMenuPart, indexMenu, 0, 0xFFFF, MM_DONTREMOVESEPS | MM_SUBMENUSHAVEIDS); - DestroyMenu(hMenuPart); + //Shell_MergeMenus(hMenu, hMenuPart, indexMenu, 0, UINT_MAX, MM_ADDSEPARATOR| MM_DONTREMOVESEPS | MM_SUBMENUSHAVEIDS); + //DestroyMenu(hMenuPart); } else { WARN("QueryContextMenu failed!\n"); } + + /* If no item was added after the separator, remove it */ + if (count == GetMenuItemCount(hMenu)) + DeleteMenu(hMenu, SeparatorIndex, MF_BYPOSITION); + } else {
8 years
1
0
0
0
[gadamopoulos] 73406: [SHELL32] - CDefaultContextMenu::QueryContextMenu : Implement CMF_VERBSONLY flag (needs tests). CORE-11488 (and all its duplicates)
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Tue Nov 29 15:44:19 2016 New Revision: 73406 URL:
http://svn.reactos.org/svn/reactos?rev=73406&view=rev
Log: [SHELL32] - CDefaultContextMenu::QueryContextMenu : Implement CMF_VERBSONLY flag (needs tests). CORE-11488 (and all its duplicates) Modified: trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp Modified: trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefault…
============================================================================== --- trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp [iso-8859-1] Tue Nov 29 15:44:19 2016 @@ -672,6 +672,9 @@ qcminfo.pIdMap = NULL; _DoCallback(DFM_MERGECONTEXTMENU, uFlags, &qcminfo); IndexMenu = GetMenuItemCount(hMenu); + + if (uFlags & CMF_VERBSONLY) + return S_OK; /* If this is a background context menu we are done */ if (!m_cidl)
8 years
1
0
0
0
[gadamopoulos] 73405: [SHELL32] - CDefViewBckgrndMenu : Add class to handle the background menu of the CDefView and handle stuff that previously were handled by CDefaultContextMenu. Let the shell f...
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Tue Nov 29 15:38:55 2016 New Revision: 73405 URL:
http://svn.reactos.org/svn/reactos?rev=73405&view=rev
Log: [SHELL32] - CDefViewBckgrndMenu : Add class to handle the background menu of the CDefView and handle stuff that previously were handled by CDefaultContextMenu. Let the shell folders fill their own part of the background context menu. - CDefView: Create a CDefViewBckgrndMenu instead of a CDefaultContextMenu which was completely wrong. - CDesktopFolder, CFSFolder: Implement returning the background context menu in CreateViewObject. Note that I am not completely sure that the callback should be adding the Properties item. - CDefaultContextMenu: Remove code that was moved to CDefViewBckgrndMenu and try to improve the overzealous debug prints regarding the shell extensions. CORE-12410, CORE-12472 Added: trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp (with props) Modified: trunk/reactos/dll/win32/shell32/CDefView.cpp trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp trunk/reactos/dll/win32/shell32/CMakeLists.txt trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.h trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp trunk/reactos/dll/win32/shell32/lang/bg-BG.rc trunk/reactos/dll/win32/shell32/lang/ca-ES.rc trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc trunk/reactos/dll/win32/shell32/lang/da-DK.rc trunk/reactos/dll/win32/shell32/lang/de-DE.rc trunk/reactos/dll/win32/shell32/lang/el-GR.rc trunk/reactos/dll/win32/shell32/lang/en-GB.rc trunk/reactos/dll/win32/shell32/lang/en-US.rc trunk/reactos/dll/win32/shell32/lang/es-ES.rc trunk/reactos/dll/win32/shell32/lang/fi-FI.rc trunk/reactos/dll/win32/shell32/lang/fr-FR.rc trunk/reactos/dll/win32/shell32/lang/he-IL.rc trunk/reactos/dll/win32/shell32/lang/hu-HU.rc trunk/reactos/dll/win32/shell32/lang/it-IT.rc trunk/reactos/dll/win32/shell32/lang/ja-JP.rc trunk/reactos/dll/win32/shell32/lang/ko-KR.rc trunk/reactos/dll/win32/shell32/lang/nl-NL.rc trunk/reactos/dll/win32/shell32/lang/no-NO.rc trunk/reactos/dll/win32/shell32/lang/pl-PL.rc trunk/reactos/dll/win32/shell32/lang/pt-BR.rc trunk/reactos/dll/win32/shell32/lang/pt-PT.rc trunk/reactos/dll/win32/shell32/lang/ro-RO.rc trunk/reactos/dll/win32/shell32/lang/ru-RU.rc trunk/reactos/dll/win32/shell32/lang/sk-SK.rc trunk/reactos/dll/win32/shell32/lang/sl-SI.rc trunk/reactos/dll/win32/shell32/lang/sq-AL.rc trunk/reactos/dll/win32/shell32/lang/sv-SE.rc trunk/reactos/dll/win32/shell32/lang/tr-TR.rc trunk/reactos/dll/win32/shell32/lang/uk-UA.rc trunk/reactos/dll/win32/shell32/lang/zh-CN.rc trunk/reactos/dll/win32/shell32/lang/zh-TW.rc trunk/reactos/dll/win32/shell32/shfldr.h Modified: trunk/reactos/dll/win32/shell32/CDefView.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefView…
============================================================================== --- trunk/reactos/dll/win32/shell32/CDefView.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CDefView.cpp [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -2223,15 +2223,13 @@ case SVGIO_BACKGROUND: if (IsEqualIID(riid, IID_IContextMenu)) { - //*ppvOut = ISvBgCm_Constructor(m_pSFParent, FALSE); if (!ppvOut) hr = E_OUTOFMEMORY; - IContextMenu* pcm; - hr = CDefFolderMenu_Create2(NULL, NULL, 0, NULL, m_pSFParent, NULL, 0, NULL, &pcm); + hr = CDefViewBckgrndMenu_CreateInstance(m_pSF2Parent, riid, ppvOut); if (FAILED_UNEXPECTEDLY(hr)) return hr; - *ppvOut = pcm; + } else if (IsEqualIID(riid, IID_IDispatch)) { Added: trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefView…
============================================================================== --- trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp (added) +++ trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -0,0 +1,286 @@ +/* + * PROJECT: shell32 + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/win32/shell32/CDefViewBckgrndMenu.cpp + * PURPOSE: background context menu of the CDefView + * PROGRAMMERS: Giannis Adamopoulos + */ + +#include <precomp.h> + +WINE_DEFAULT_DEBUG_CHANNEL(shell); + +class CDefViewBckgrndMenu : + public CComObjectRootEx<CComMultiThreadModelNoCS>, + public IContextMenu3, + public IObjectWithSite +{ + private: + CComPtr<IUnknown> m_site; + CComPtr<IShellFolder> m_psf; + CComPtr<IContextMenu> m_folderCM; + + BOOL _bIsDesktopBrowserMenu(); + BOOL _bCanPaste(); + public: + CDefViewBckgrndMenu(); + ~CDefViewBckgrndMenu(); + HRESULT Initialize(IShellFolder* psf); + + // IContextMenu + virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); + virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi); + virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen); + + // IContextMenu2 + virtual HRESULT WINAPI HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam); + + // IContextMenu3 + virtual HRESULT WINAPI HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult); + + // IObjectWithSite + virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite); + virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, void **ppvSite); + + BEGIN_COM_MAP(CDefViewBckgrndMenu) + COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu) + COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2) + COM_INTERFACE_ENTRY_IID(IID_IContextMenu3, IContextMenu3) + COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite) + END_COM_MAP() +}; + +CDefViewBckgrndMenu::CDefViewBckgrndMenu() +{ +} + +CDefViewBckgrndMenu::~CDefViewBckgrndMenu() +{ +} + +BOOL CDefViewBckgrndMenu::_bIsDesktopBrowserMenu() +{ + if (!m_site) + return FALSE; + + /* Get a pointer to the shell browser */ + CComPtr<IShellView> psv; + HRESULT hr = IUnknown_QueryService(m_site, SID_IFolderView, IID_PPV_ARG(IShellView, &psv)); + if (FAILED_UNEXPECTEDLY(hr)) + return FALSE; + + FOLDERSETTINGS FolderSettings; + hr = psv->GetCurrentInfo(&FolderSettings); + if (FAILED_UNEXPECTEDLY(hr)) + return FALSE; + + return ((FolderSettings.fFlags & FWF_DESKTOP) == FWF_DESKTOP); +} + +BOOL CDefViewBckgrndMenu::_bCanPaste() +{ + /* If the folder doesn't have a drop target we can't paste */ + CComPtr<IDropTarget> pdt; + HRESULT hr = m_psf->CreateViewObject(NULL, IID_PPV_ARG(IDropTarget, &pdt)); + if (FAILED(hr)) + return FALSE; + + /* We can only paste if CFSTR_SHELLIDLIST is present in the clipboard */ + CComPtr<IDataObject> pDataObj; + hr = OleGetClipboard(&pDataObj); + if (FAILED(hr)) + return FALSE; + + STGMEDIUM medium; + FORMATETC formatetc; + + /* Set the FORMATETC structure*/ + InitFormatEtc(formatetc, RegisterClipboardFormatW(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); + hr = pDataObj->GetData(&formatetc, &medium); + if (FAILED(hr)) + return FALSE; + + ReleaseStgMedium(&medium); + return TRUE; +} + +HRESULT +CDefViewBckgrndMenu::Initialize(IShellFolder* psf) +{ + m_psf = psf; + return S_OK; +} + +HRESULT +WINAPI +CDefViewBckgrndMenu::SetSite(IUnknown *pUnkSite) +{ + m_site = pUnkSite; + return S_OK; +} + +HRESULT +WINAPI +CDefViewBckgrndMenu::GetSite(REFIID riid, void **ppvSite) +{ + if (!m_site) + return E_FAIL; + + return m_site->QueryInterface(riid, ppvSite); +} + +HRESULT +WINAPI +CDefViewBckgrndMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) +{ + HRESULT hr; + HMENU hMenuPart; + + /* Load the default part of the background context menu */ + hMenuPart = LoadMenuW(shell32_hInstance, L"MENU_002"); + if (hMenuPart) + { + /* Don't show the view submenu for the desktop */ + if (_bIsDesktopBrowserMenu()) + { + DeleteMenu(hMenuPart, FCIDM_SHVIEW_VIEW, MF_BYCOMMAND); + } + + /* Disable the paste options if it is not possible */ + if (!_bCanPaste()) + { + EnableMenuItem(hMenuPart, FCIDM_SHVIEW_INSERT, MF_BYCOMMAND | MF_GRAYED); + EnableMenuItem(hMenuPart, FCIDM_SHVIEW_INSERTLINK, MF_BYCOMMAND | MF_GRAYED); + } + + /* merge general background context menu in */ + Shell_MergeMenus(hMenu, GetSubMenu(hMenuPart, 0), indexMenu, 0, 0xFFFF, MM_DONTREMOVESEPS | MM_SUBMENUSHAVEIDS); + indexMenu += GetMenuItemCount(GetSubMenu(hMenuPart, 0)); + DestroyMenu(hMenuPart); + } + else + { + ERR("Failed to load menu from resource!\n"); + } + + /* Query the shell folder to add any items it wants to add in the background context menu */ + hMenuPart = CreatePopupMenu(); + if (hMenuPart) + { + hr = m_psf->CreateViewObject(NULL, IID_PPV_ARG(IContextMenu, &m_folderCM)); + if (SUCCEEDED(hr)) + { + hr = m_folderCM->QueryContextMenu(hMenuPart, 0, idCmdFirst, idCmdLast, uFlags); + if (SUCCEEDED(hr)) + { + Shell_MergeMenus(hMenu, hMenuPart, indexMenu, 0, 0xFFFF, MM_DONTREMOVESEPS | MM_SUBMENUSHAVEIDS); + DestroyMenu(hMenuPart); + } + else + { + WARN("QueryContextMenu failed!\n"); + } + } + else + { + WARN("GetUIObjectOf didn't give any context menu!\n"); + } + } + else + { + ERR("CreatePopupMenu failed!\n"); + } + + return S_OK; +} + +HRESULT +WINAPI +CDefViewBckgrndMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi) +{ + /* The commands that are handled by the def view are forwarded to it */ + switch (LOWORD(lpcmi->lpVerb)) + { + case FCIDM_SHVIEW_BIGICON: + case FCIDM_SHVIEW_SMALLICON: + case FCIDM_SHVIEW_LISTVIEW: + case FCIDM_SHVIEW_REPORTVIEW: + case 0x30: /* FIX IDS in resource files */ + case 0x31: + case 0x32: + case 0x33: + case FCIDM_SHVIEW_AUTOARRANGE: + case FCIDM_SHVIEW_SNAPTOGRID: + case FCIDM_SHVIEW_REFRESH: + if (!m_site) + return E_FAIL; + + /* Get a pointer to the shell browser */ + CComPtr<IShellView> psv; + HRESULT hr = IUnknown_QueryService(m_site, SID_IFolderView, IID_PPV_ARG(IShellView, &psv)); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + HWND hwndSV = NULL; + if (SUCCEEDED(psv->GetWindow(&hwndSV))) + SendMessageW(hwndSV, WM_COMMAND, MAKEWPARAM(LOWORD(lpcmi->lpVerb), 0), 0); + return S_OK; + } + + /* Unknown commands are added by the folder context menu so forward the invocation */ + return m_folderCM->InvokeCommand(lpcmi); + +} + +HRESULT +WINAPI +CDefViewBckgrndMenu::GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen) +{ + if (m_folderCM) + { + return m_folderCM->GetCommandString(idCommand, uFlags, lpReserved, lpszName, uMaxNameLen); + } + + return E_NOTIMPL; +} + +HRESULT +WINAPI +CDefViewBckgrndMenu::HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + if(m_folderCM) + { + CComPtr<IContextMenu2> pfolderCM2; + HRESULT hr = m_folderCM->QueryInterface(IID_PPV_ARG(IContextMenu2, &pfolderCM2)); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + return pfolderCM2->HandleMenuMsg(uMsg, wParam, lParam); + } + + return E_NOTIMPL; +} + +HRESULT +WINAPI +CDefViewBckgrndMenu::HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult) +{ + if(m_folderCM) + { + CComPtr<IContextMenu3> pfolderCM3; + HRESULT hr = m_folderCM->QueryInterface(IID_PPV_ARG(IContextMenu3, &pfolderCM3)); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + return pfolderCM3->HandleMenuMsg2(uMsg, wParam, lParam, plResult); + } + + return E_NOTIMPL; +} + + +HRESULT +CDefViewBckgrndMenu_CreateInstance(IShellFolder* psf, REFIID riid, void **ppv) +{ + return ShellObjectCreatorInit<CDefViewBckgrndMenu>(psf, riid, ppv); +} Propchange: trunk/reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefault…
============================================================================== --- trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -84,14 +84,11 @@ HRESULT LoadDynamicContextMenuHandler(HKEY hKey, const CLSID *pclsid); BOOL EnumerateDynamicContextHandlerForKey(HKEY hRootKey); UINT InsertMenuItemsOfDynamicContextMenuExtension(HMENU hMenu, UINT IndexMenu, UINT idCmdFirst, UINT idCmdLast); - UINT BuildBackgroundContextMenu(HMENU hMenu, UINT iIdCmdFirst, UINT iIdCmdLast, UINT uFlags); UINT AddStaticContextMenusToMenu(HMENU hMenu, UINT IndexMenu); UINT BuildShellItemContextMenu(HMENU hMenu, UINT iIdCmdFirst, UINT iIdCmdLast, UINT uFlags); - HRESULT NotifyShellViewWindow(LPCMINVOKECOMMANDINFO lpcmi, BOOL bRefresh); HRESULT DoPaste(LPCMINVOKECOMMANDINFO lpcmi, BOOL bLink); HRESULT DoOpenOrExplore(LPCMINVOKECOMMANDINFO lpcmi); HRESULT DoCreateLink(LPCMINVOKECOMMANDINFO lpcmi); - HRESULT DoRefresh(LPCMINVOKECOMMANDINFO lpcmi); HRESULT DoDelete(LPCMINVOKECOMMANDINFO lpcmi); HRESULT DoCopyOrCut(LPCMINVOKECOMMANDINFO lpcmi, BOOL bCopy); HRESULT DoRename(LPCMINVOKECOMMANDINFO lpcmi); @@ -188,6 +185,12 @@ { TRACE("cidl %u\n", pdcm->cidl); + if (!pdcm->pcmcb && !lpfn) + { + ERR("CDefaultContextMenu needs a callback!\n"); + return E_INVALIDARG; + } + m_cidl = pdcm->cidl; m_apidl = const_cast<PCUITEMID_CHILD_ARRAY>(_ILCopyaPidl(pdcm->apidl, m_cidl)); if (m_cidl && !m_apidl) @@ -236,7 +239,7 @@ return m_pfnmcb(m_psf, NULL, m_pDataObj, uMsg, wParam, (LPARAM)lParam); } - return S_OK; + return E_FAIL; } void CDefaultContextMenu::AddStaticEntry(const HKEY hkeyClass, const WCHAR *szVerb) @@ -325,20 +328,6 @@ return bRet; } -static -VOID -DisablePasteOptions(HMENU hMenu) -{ - MENUITEMINFOW mii; - - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_STATE; - mii.fState = MFS_DISABLED; - - SetMenuItemInfoW(hMenu, FCIDM_SHVIEW_INSERT, FALSE, &mii); - SetMenuItemInfoW(hMenu, FCIDM_SHVIEW_INSERTLINK, FALSE, &mii); -} - BOOL CDefaultContextMenu::IsShellExtensionAlreadyLoaded(const CLSID *pclsid) { @@ -375,8 +364,11 @@ return hr; hr = pExtInit->Initialize(m_pidlFolder, m_pDataObj, hKey); - if (FAILED_UNEXPECTEDLY(hr)) + if (FAILED(hr)) + { + WARN("IShellExtInit::Initialize failed.clsid %s hr 0x%x\n", wine_dbgstr_guid(pclsid), hr); return hr; + } PDynamicShellEntry pEntry = (DynamicShellEntry *)HeapAlloc(GetProcessHeap(), 0, sizeof(DynamicShellEntry)); if (!pEntry) @@ -406,7 +398,6 @@ BOOL CDefaultContextMenu::EnumerateDynamicContextHandlerForKey(HKEY hRootKey) { - WCHAR wszName[MAX_PATH], wszBuf[MAX_PATH], *pwszClsid; DWORD cchName; HRESULT hr; @@ -437,24 +428,31 @@ hr = CLSIDFromString(wszBuf, &clsid); pwszClsid = wszBuf; } - if (SUCCEEDED(hr)) - { - if (m_bGroupPolicyActive) + + if (FAILED(hr)) + { + ERR("CLSIDFromString failed for clsid %S hr 0x%x\n", pwszClsid, hr); + continue; + } + + if (m_bGroupPolicyActive) + { + if (RegGetValueW(HKEY_LOCAL_MACHINE, + L"Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved", + pwszClsid, + RRF_RT_REG_SZ, + NULL, + NULL, + NULL) != ERROR_SUCCESS) { - if (RegGetValueW(HKEY_LOCAL_MACHINE, - L"Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved", - pwszClsid, - RRF_RT_REG_SZ, - NULL, - NULL, - NULL) == ERROR_SUCCESS) - { - LoadDynamicContextMenuHandler(hKey, &clsid); - } + ERR("Shell extension %s not approved!\n", pwszClsid); + continue; } - else - LoadDynamicContextMenuHandler(hKey, &clsid); - } + } + + hr = LoadDynamicContextMenuHandler(hKey, &clsid); + if (FAILED(hr)) + WARN("Failed to get context menu entires from shell extension! clsid: %S\n", pwszClsid); } RegCloseKey(hKey); @@ -492,66 +490,6 @@ m_iIdSHELast = idCmdFirst; TRACE("SH_LoadContextMenuHandlers first %x last %x\n", m_iIdSHEFirst, m_iIdSHELast); return IndexMenu; -} - -UINT -CDefaultContextMenu::BuildBackgroundContextMenu( - HMENU hMenu, - UINT iIdCmdFirst, - UINT iIdCmdLast, - UINT uFlags) -{ - UINT IndexMenu = 0; - HMENU hSubMenu; - - TRACE("BuildBackgroundContextMenu entered\n"); - - SFGAOF rfg = SFGAO_FILESYSTEM | SFGAO_FOLDER; - HRESULT hr = m_psf->GetAttributesOf(0, NULL, &rfg); - if (FAILED(hr)) - { - ERR("GetAttributesOf failed: %x\n", hr); - rfg = 0; - } - - hSubMenu = LoadMenuW(shell32_hInstance, L"MENU_002"); - if (hSubMenu) - { - /* view option is only available in browsing mode */ - if (_ILIsDesktop(m_pidlFolder)) - DeleteMenu(hSubMenu, FCIDM_SHVIEW_VIEW, MF_BYCOMMAND); - - /* merge general background context menu in */ - iIdCmdFirst = Shell_MergeMenus(hMenu, GetSubMenu(hSubMenu, 0), IndexMenu, 0, 0xFFFF, MM_DONTREMOVESEPS | MM_SUBMENUSHAVEIDS) + 1; - DestroyMenu(hSubMenu); - } - - if (!HasClipboardData()) - { - TRACE("disabling paste options\n"); - DisablePasteOptions(hMenu); - } - - /* Directory is progid of filesystem folders only */ - if ((rfg & (SFGAO_FILESYSTEM|SFGAO_FOLDER)) == (SFGAO_FILESYSTEM|SFGAO_FOLDER)) - { - /* Load context menu handlers */ - TRACE("Add background handlers: %p\n", m_pidlFolder); - HKEY hKey; - if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"Directory\\Background", 0, KEY_READ, &hKey) == ERROR_SUCCESS) - { - EnumerateDynamicContextHandlerForKey(hKey); - RegCloseKey(hKey); - } - - if (InsertMenuItemsOfDynamicContextMenuExtension(hMenu, GetMenuItemCount(hMenu) - 1, iIdCmdFirst, iIdCmdLast)) - { - /* seperate dynamic context menu items */ - _InsertMenuItemW(hMenu, GetMenuItemCount(hMenu) - 1, TRUE, -1, MFT_SEPARATOR, NULL, MFS_ENABLED); - } - } - - return iIdCmdLast; } UINT @@ -697,51 +635,55 @@ InsertMenuItemW(hMenu, indexMenu, fByPosition, &mii); } -UINT -CDefaultContextMenu::BuildShellItemContextMenu( +HRESULT +WINAPI +CDefaultContextMenu::QueryContextMenu( HMENU hMenu, - UINT iIdCmdFirst, - UINT iIdCmdLast, + UINT IndexMenu, + UINT idCmdFirst, + UINT idCmdLast, UINT uFlags) { HRESULT hr; TRACE("BuildShellItemContextMenu entered\n"); - ASSERT(m_cidl >= 1); - + + /* Load static verbs and shell extensions from registry */ for (UINT i = 0; i < m_cKeys; i++) { AddStaticEntriesForKey(m_aKeys[i]); EnumerateDynamicContextHandlerForKey(m_aKeys[i]); } - /* 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_psf->GetAttributesOf(m_cidl, m_apidl, &rfg); - if (FAILED(hr)) - { - ERR("GetAttributesOf failed: %x\n", hr); - rfg = 0; - } - - /* add static context menu handlers */ - UINT IndexMenu = AddStaticContextMenusToMenu(hMenu, 0); - - /* now process dynamic context menu handlers */ + /* Add static context menu handlers */ + IndexMenu = AddStaticContextMenusToMenu(hMenu, IndexMenu); + + /* Add dynamic context menu handlers */ BOOL bAddSep = FALSE; - IndexMenu = InsertMenuItemsOfDynamicContextMenuExtension(hMenu, IndexMenu, iIdCmdFirst, iIdCmdLast); + IndexMenu = InsertMenuItemsOfDynamicContextMenuExtension(hMenu, IndexMenu, idCmdFirst, idCmdLast); TRACE("IndexMenu %d\n", IndexMenu); /* Now let the callback add its own items */ QCMINFO qcminfo; qcminfo.hmenu = hMenu; qcminfo.indexMenu = IndexMenu; - qcminfo.idCmdFirst = iIdCmdFirst; - qcminfo.idCmdLast = iIdCmdLast; + qcminfo.idCmdFirst = idCmdFirst; + qcminfo.idCmdLast = idCmdLast; qcminfo.pIdMap = NULL; _DoCallback(DFM_MERGECONTEXTMENU, uFlags, &qcminfo); IndexMenu = GetMenuItemCount(hMenu); + /* If this is a background context menu we are done */ + if (!m_cidl) + return S_OK; + + /* Get the attributes of the items */ + SFGAOF rfg = SFGAO_BROWSABLE | SFGAO_CANCOPY | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANDELETE | SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_FILESYSTEM | SFGAO_FOLDER; + hr = m_psf->GetAttributesOf(m_cidl, m_apidl, &rfg); + if (FAILED_UNEXPECTEDLY(hr)) + return S_OK; + + /* Add the standard menu entries based on the attributes of the items */ BOOL bClipboardData = (HasClipboardData() && (rfg & SFGAO_FILESYSTEM)); if (rfg & (SFGAO_CANCOPY | SFGAO_CANMOVE) || bClipboardData) { @@ -788,60 +730,6 @@ _InsertMenuItemW(hMenu, IndexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); _InsertMenuItemW(hMenu, IndexMenu++, TRUE, FCIDM_SHVIEW_PROPERTIES, MFT_STRING, MAKEINTRESOURCEW(IDS_PROPERTIES), MFS_ENABLED); } - - return iIdCmdLast; -} - -HRESULT -WINAPI -CDefaultContextMenu::QueryContextMenu( - HMENU hMenu, - UINT IndexMenu, - UINT idCmdFirst, - UINT idCmdLast, - UINT uFlags) -{ - if (m_cidl) - idCmdFirst = BuildShellItemContextMenu(hMenu, idCmdFirst, idCmdLast, uFlags); - else - idCmdFirst = BuildBackgroundContextMenu(hMenu, idCmdFirst, idCmdLast, uFlags); - - return S_OK; -} - -HRESULT -CDefaultContextMenu::NotifyShellViewWindow(LPCMINVOKECOMMANDINFO lpcmi, BOOL bRefresh) -{ - if (!m_site) - return E_FAIL; - - /* Get a pointer to the shell browser */ - CComPtr<IShellView> psv; - HRESULT hr = IUnknown_QueryService(m_site, SID_IFolderView, IID_PPV_ARG(IShellView, &psv)); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; - - HWND hwndSV = NULL; - if (SUCCEEDED(psv->GetWindow(&hwndSV))) - SendMessageW(hwndSV, WM_COMMAND, MAKEWPARAM(LOWORD(lpcmi->lpVerb), 0), 0); - return S_OK; -} - - -HRESULT CDefaultContextMenu::DoRefresh(LPCMINVOKECOMMANDINFO lpcmi) -{ - if (!m_site) - return E_FAIL; - - /* Get a pointer to the shell view */ - CComPtr<IShellView> psv; - HRESULT hr = IUnknown_QueryService(m_site, SID_IFolderView, IID_PPV_ARG(IShellView, &psv)); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; - - hr = psv->Refresh(); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; return S_OK; } @@ -1285,21 +1173,6 @@ /* Check if this is a Id */ switch (LOWORD(LocalInvokeInfo.lpVerb)) { - case FCIDM_SHVIEW_BIGICON: - case FCIDM_SHVIEW_SMALLICON: - case FCIDM_SHVIEW_LISTVIEW: - case FCIDM_SHVIEW_REPORTVIEW: - case 0x30: /* FIX IDS in resource files */ - case 0x31: - case 0x32: - case 0x33: - case FCIDM_SHVIEW_AUTOARRANGE: - case FCIDM_SHVIEW_SNAPTOGRID: - Result = NotifyShellViewWindow(&LocalInvokeInfo, FALSE); - break; - case FCIDM_SHVIEW_REFRESH: - Result = DoRefresh(&LocalInvokeInfo); - break; case FCIDM_SHVIEW_INSERT: Result = DoPaste(&LocalInvokeInfo, FALSE); break; Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -63,6 +63,7 @@ CFileSysBindData.cpp CDefView.cpp CDefViewDual.cpp + CDefViewBckgrndMenu.cpp stubs.cpp systray.cpp CDefaultContextMenu.cpp Modified: trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -529,8 +529,21 @@ } else if (IsEqualIID (riid, IID_IContextMenu)) { - WARN ("IContextMenu not implemented\n"); - hr = E_NOTIMPL; + HKEY hKeys[16]; + UINT cKeys = 0; + AddClassKeyToArray(L"Directory\\Background", hKeys, &cKeys); + + DEFCONTEXTMENU dcm; + dcm.hwnd = hwndOwner; + dcm.pcmcb = this; + dcm.pidlFolder = pidlRoot; + dcm.psf = this; + dcm.cidl = 0; + dcm.apidl = NULL; + dcm.cKeys = cKeys; + dcm.aKeys = hKeys; + dcm.punkAssociationInfo = NULL; + hr = SHCreateDefaultContextMenu (&dcm, riid, ppvOut); } else if (IsEqualIID (riid, IID_IShellView)) { @@ -646,13 +659,23 @@ else { /* Do not use the context menu of the CFSFolder here. */ - /* We need to pass a pointer of the CDesktopFolder so as the data object that the context menu gets is rooted to the desktop */ + /* We need to pass a pointer of the CDesktopFolder so as the data object that the context menu gets is rooted to the desktop */ /* Otherwise operations like that involve items from both user and shared desktop will not work */ - IContextMenu * pCm = NULL; HKEY hKeys[16]; UINT cKeys = 0; AddFSClassKeysToArray(apidl[0], hKeys, &cKeys); - hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), NULL, cKeys, hKeys, &pCm); + + DEFCONTEXTMENU dcm; + dcm.hwnd = hwndOwner; + dcm.pcmcb = this; + dcm.pidlFolder = pidlRoot; + dcm.psf = this; + dcm.cidl = cidl; + dcm.apidl = apidl; + dcm.cKeys = cKeys; + dcm.aKeys = hKeys; + dcm.punkAssociationInfo = NULL; + hr = SHCreateDefaultContextMenu (&dcm, riid, &pObj); } } else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1)) @@ -844,6 +867,59 @@ return S_OK; } +HRESULT WINAPI CDesktopFolder::CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + if (uMsg != DFM_MERGECONTEXTMENU && uMsg != DFM_INVOKECOMMAND) + return S_OK; + + /* no data object means no selection */ + if (!pdtobj) + { + if (uMsg == DFM_INVOKECOMMAND && wParam == DFM_CMD_PROPERTIES) + { + if (32 >= (UINT)ShellExecuteW(hwndOwner, L"open", L"rundll32.exe shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL)) + return E_FAIL; + return S_OK; + } + else if (uMsg == DFM_MERGECONTEXTMENU) + { + QCMINFO *pqcminfo = (QCMINFO *)lParam; + _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); + _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, FCIDM_SHVIEW_PROPERTIES, MFT_STRING, MAKEINTRESOURCEW(IDS_PROPERTIES), MFS_ENABLED); + } + + return S_OK; + } + + PIDLIST_ABSOLUTE pidlFolder; + PUITEMID_CHILD *apidl; + UINT cidl; + HRESULT hr = SH_GetApidlFromDataObject(pdtobj, &pidlFolder, &apidl, &cidl); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + if (cidl > 1) + ERR("SHMultiFileProperties is not yet implemented\n"); + + STRRET strFile; + hr = GetDisplayNameOf(apidl[0], SHGDN_FORPARSING, &strFile); + if (SUCCEEDED(hr)) + { + hr = SH_ShowPropertiesDialog(strFile.pOleStr, pidlFolder, apidl); + if (FAILED(hr)) + ERR("SH_ShowPropertiesDialog failed\n"); + } + else + { + ERR("Failed to get display name\n"); + } + + SHFree(pidlFolder); + _ILFreeaPidl(apidl, cidl); + + return hr; +} + /************************************************************************* * SHGetDesktopFolder [SHELL32.@] */ Modified: trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.h [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -27,7 +27,8 @@ public CComCoClass<CDesktopFolder, &CLSID_ShellDesktop>, public CComObjectRootEx<CComMultiThreadModelNoCS>, public IShellFolder2, - public IPersistFolder2 + public IPersistFolder2, + public IContextMenuCB { private: /* both paths are parsible from the desktop */ @@ -75,6 +76,9 @@ // *** IPersistFolder2 methods *** virtual HRESULT WINAPI GetCurFolder(LPITEMIDLIST * pidl); + // IContextMenuCB + virtual HRESULT WINAPI CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam); + DECLARE_REGISTRY_RESOURCEID(IDR_SHELLDESKTOP) DECLARE_CENTRAL_INSTANCE_NOT_AGGREGATABLE(CDesktopFolder) Modified: trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -371,8 +371,21 @@ hr = CFSDropTarget_CreateInstance(sPathTarget, riid, ppvOut); else if (IsEqualIID (riid, IID_IContextMenu)) { - FIXME ("IContextMenu not implemented\n"); - hr = E_NOTIMPL; + HKEY hKeys[16]; + UINT cKeys = 0; + AddClassKeyToArray(L"Directory\\Background", hKeys, &cKeys); + + DEFCONTEXTMENU dcm; + dcm.hwnd = hwndOwner; + dcm.pcmcb = this; + dcm.pidlFolder = pidlRoot; + dcm.psf = this; + dcm.cidl = 0; + dcm.apidl = NULL; + dcm.cKeys = cKeys; + dcm.aKeys = hKeys; + dcm.punkAssociationInfo = NULL; + hr = SHCreateDefaultContextMenu (&dcm, riid, ppvOut); } else if (IsEqualIID (riid, IID_IShellView)) { @@ -513,7 +526,7 @@ } else { - hr = IDataObject_Constructor (hwndOwner, pidlRoot, (LPCITEMIDLIST*)&pidlRoot, 1, (IDataObject **)&pObj); + hr = E_INVALIDARG; } } else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1)) @@ -1101,6 +1114,33 @@ HRESULT WINAPI CFSFolder::CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam) { + if (uMsg != DFM_MERGECONTEXTMENU && uMsg != DFM_INVOKECOMMAND) + return S_OK; + + /* no data object means no selection */ + if (!pdtobj) + { + if (uMsg == DFM_INVOKECOMMAND && wParam == DFM_CMD_PROPERTIES) + { + PUITEMID_CHILD pidlChild = ILClone(ILFindLastID(pidlRoot)); + LPITEMIDLIST pidlParent = ILClone(pidlRoot); + ILRemoveLastID(pidlParent); + HRESULT hr = SH_ShowPropertiesDialog(sPathTarget, pidlParent, &pidlChild); + if (FAILED(hr)) + ERR("SH_ShowPropertiesDialog failed\n"); + ILFree(pidlChild); + ILFree(pidlParent); + } + else if (uMsg == DFM_MERGECONTEXTMENU) + { + QCMINFO *pqcminfo = (QCMINFO *)lParam; + _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); + _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, FCIDM_SHVIEW_PROPERTIES, MFT_STRING, MAKEINTRESOURCEW(IDS_PROPERTIES), MFS_ENABLED); + } + + return S_OK; + } + if (uMsg != DFM_INVOKECOMMAND || wParam != DFM_CMD_PROPERTIES) return S_OK; Modified: trunk/reactos/dll/win32/shell32/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/bg-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/bg-BG.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "ÐоÑÑавÑне", FCIDM_SHVIEW_INSERT MENUITEM "ÐоÑÑавÑне каÑо вÑÑзка", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "СвойÑÑва", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/ca-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ca-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/ca-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/ca-ES.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Paste", FCIDM_SHVIEW_INSERT MENUITEM "Paste as Link", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Properties", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/cs-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -44,8 +44,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "V&ložit", FCIDM_SHVIEW_INSERT MENUITEM "Vložit zást&upce", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "&Vlastnosti", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/da-DK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/da-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/da-DK.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/da-DK.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -44,8 +44,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Indsæt", FCIDM_SHVIEW_INSERT MENUITEM "Indsæt som Link", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Egenskaber", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/de-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/de-DE.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Einfügen", FCIDM_SHVIEW_INSERT MENUITEM "Einfügen als Verweis", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "&Eigenschaften", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/el-GR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/el-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/el-GR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/el-GR.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "ÎÏικÏληÏη", FCIDM_SHVIEW_INSERT MENUITEM "ÎÏικÏληÏη ÏÏ Î½ÏÏÎ¼ÎµÏ ÏηÏ", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "ÎδιÏÏηÏεÏ", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/en-GB.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/en-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/en-GB.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/en-GB.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Paste", FCIDM_SHVIEW_INSERT MENUITEM "Paste as Link", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Properties", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/en-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/en-US.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Paste", FCIDM_SHVIEW_INSERT MENUITEM "Paste as Link", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Properties", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/es-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/es-ES.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -40,8 +40,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Pegar", FCIDM_SHVIEW_INSERT MENUITEM "Pegar acceso directo", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Propiedades", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/fi-FI.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/fi-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/fi-FI.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/fi-FI.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Liitä", FCIDM_SHVIEW_INSERT MENUITEM "Liitä Linkiksi", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Ominaisuudet", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/fr-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/fr-FR.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Coller", FCIDM_SHVIEW_INSERT MENUITEM "Coller comme un lien", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Propriétés", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/he-IL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/he-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/he-IL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/he-IL.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "×××ק", FCIDM_SHVIEW_INSERT MENUITEM "×××ק ×ק×צ×ר ×ר×", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "××פ××× ××", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/hu-HU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/hu-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/hu-HU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/hu-HU.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Beillesztés", FCIDM_SHVIEW_INSERT MENUITEM "Parancsikon beillesztése", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "BeállÃtások", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/it-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/it-IT.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Incolla", FCIDM_SHVIEW_INSERT MENUITEM "Crea Collegamento", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Proprietà ", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/ja-JP.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ja-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/ja-JP.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/ja-JP.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "è²¼ãä»ã", FCIDM_SHVIEW_INSERT MENUITEM "ã·ã§ã¼ãã«ããã®è²¼ãä»ã", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "ããããã£", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/ko-KR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ko-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/ko-KR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/ko-KR.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Paste", FCIDM_SHVIEW_INSERT MENUITEM "Paste as Link", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Properties", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/nl-NL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/nl-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/nl-NL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/nl-NL.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Paste", FCIDM_SHVIEW_INSERT MENUITEM "Paste as Link", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Properties", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/no-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/no-NO.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Lim inn", FCIDM_SHVIEW_INSERT MENUITEM "Lim inn som snarvei", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Egenskaper", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/pl-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/pl-PL.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -42,8 +42,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "W&klej", FCIDM_SHVIEW_INSERT MENUITEM "Wklej s&krót", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "WÅaÅciwoÅci", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/pt-BR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/pt-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/pt-BR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/pt-BR.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Co&lar", FCIDM_SHVIEW_INSERT MENUITEM "Colar a&talho", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Propriedades", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/pt-PT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/pt-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/pt-PT.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/pt-PT.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Co&lar", FCIDM_SHVIEW_INSERT MENUITEM "Colar a&talho", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Propriedades", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ro-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/ro-RO.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/ro-RO.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -40,8 +40,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "&LipeÈte", FCIDM_SHVIEW_INSERT MENUITEM "LipeÈte ca sc&urtÄturÄ", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "&ProprietÄÈi", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ru-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/ru-RU.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -40,8 +40,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "&ÐÑÑавиÑÑ", FCIDM_SHVIEW_INSERT MENUITEM "ÐÑÑавиÑÑ &ÑÑлÑк", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Сво&йÑÑва", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/sk-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/sk-SK.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "&Prilepiť", FCIDM_SHVIEW_INSERT MENUITEM "Prilepiť od&kaz", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Vl&astnosti", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/sl-SI.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/sl-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/sl-SI.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/sl-SI.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Paste", FCIDM_SHVIEW_INSERT MENUITEM "Paste as Link", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Properties", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/sq-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/sq-AL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/sq-AL.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -42,8 +42,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Ngjit", FCIDM_SHVIEW_INSERT MENUITEM "Ngjit si Lidhje", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Cilësime", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/sv-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/sv-SE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/sv-SE.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Klistra in", FCIDM_SHVIEW_INSERT MENUITEM "Klistra in som genväg", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "Egenskaper", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/tr-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/tr-TR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/tr-TR.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -40,8 +40,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Y&apıÅtır", FCIDM_SHVIEW_INSERT MENUITEM "K&ısayol YapıÅtır", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "&Husûsîyetler", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/uk-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/uk-UA.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -38,8 +38,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "ÐÑÑавиÑи", FCIDM_SHVIEW_INSERT MENUITEM "ÐÑÑавиÑи ÑÑлик", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "ÐлаÑÑивоÑÑÑ", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/zh-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/zh-CN.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/zh-CN.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -47,8 +47,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "ç²è´´", FCIDM_SHVIEW_INSERT MENUITEM "ç²è´´å¿«æ·æ¹å¼", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "å±æ§", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/zh-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/zh-TW.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/zh-TW.rc [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -46,8 +46,6 @@ MENUITEM "", -1, MFT_SEPARATOR MENUITEM "è²¼ä¸", FCIDM_SHVIEW_INSERT MENUITEM "è²¼ä¸æ·å¾", FCIDM_SHVIEW_INSERTLINK - MENUITEM "", -1, MFT_SEPARATOR - MENUITEM "屬æ§", FCIDM_SHVIEW_PROPERTIES END END Modified: trunk/reactos/dll/win32/shell32/shfldr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr.h…
============================================================================== --- trunk/reactos/dll/win32/shell32/shfldr.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shfldr.h [iso-8859-1] Tue Nov 29 15:38:55 2016 @@ -63,6 +63,8 @@ void AddFSClassKeysToArray(PCUITEMID_CHILD pidl, HKEY* array, UINT* cKeys); +HRESULT CDefViewBckgrndMenu_CreateInstance(IShellFolder* psf, REFIID riid, void **ppv); + HRESULT SH_GetApidlFromDataObject(IDataObject *pDataObject, PIDLIST_ABSOLUTE* ppidlfolder, PUITEMID_CHILD **apidlItems, UINT *pcidl); static __inline int SHELL32_GUIDToStringA (REFGUID guid, LPSTR str)
8 years
1
0
0
0
[gadamopoulos] 73404: [SHELL32_APITEST] -Test if CFSFolder::GetUIObjectOf can return an IDataObject for 0 cidl.
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Tue Nov 29 13:27:21 2016 New Revision: 73404 URL:
http://svn.reactos.org/svn/reactos?rev=73404&view=rev
Log: [SHELL32_APITEST] -Test if CFSFolder::GetUIObjectOf can return an IDataObject for 0 cidl. Modified: trunk/rostests/apitests/shell32/CFSFolder.cpp Modified: trunk/rostests/apitests/shell32/CFSFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/shell32/CFSFolde…
============================================================================== --- trunk/rostests/apitests/shell32/CFSFolder.cpp [iso-8859-1] (original) +++ trunk/rostests/apitests/shell32/CFSFolder.cpp [iso-8859-1] Tue Nov 29 13:27:21 2016 @@ -160,6 +160,20 @@ ok(wcscmp(strretName.pOleStr, L"C:\\") == 0, "wrong name, got: %S\n", strretName.pOleStr); } +VOID TestGetUIObjectOf() +{ + HRESULT hr; + + /* Create a CFSFolder */ + CComPtr<IShellFolder> psf; + hr = CoCreateInstance(CLSID_ShellFSFolder, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IShellFolder, &psf)); + ok(hr == S_OK, "hr = %lx\n", hr); + + /* test 0 cidl for IDataObject */ + CComPtr<IDataObject> pdo; + hr = psf->GetUIObjectOf(NULL, 0, NULL, IID_NULL_PPV_ARG(IDataObject, &pdo)); + ok(hr == E_INVALIDARG, "hr = %lx\n", hr); +} START_TEST(CFSFolder) { @@ -167,4 +181,5 @@ TestUninitialized(); TestInitialize(); + TestGetUIObjectOf(); }
8 years
1
0
0
0
[jimtabor] 73403: [Win32SS] - Revert HAX : Fix validating region with null. See CORE-12169 and related issues.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Nov 28 16:48:39 2016 New Revision: 73403 URL:
http://svn.reactos.org/svn/reactos?rev=73403&view=rev
Log: [Win32SS] - Revert HAX : Fix validating region with null. See CORE-12169 and related issues. Modified: trunk/reactos/win32ss/user/ntuser/painting.c trunk/reactos/win32ss/user/ntuser/simplecall.c Modified: trunk/reactos/win32ss/user/ntuser/painting.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/painti…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/painting.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/painting.c [iso-8859-1] Mon Nov 28 16:48:39 2016 @@ -1158,33 +1158,13 @@ } // -// Hax around internal painting of windows. +// Internal painting of windows. // VOID FASTCALL IntPaintWindow( PWND Window ) { // Handle normal painting. co_IntPaintWindows( Window, RDW_NOCHILDREN, FALSE ); - - // Hack to prevent more spamming from misbehaving application. - // Handle it like a begin/end paint - if (Window->hrgnUpdate != NULL) - { - ERR("HAX hrgnUpdate not NULL! Dec Paint Count!\n"); - MsqDecPaintCountQueue(Window->head.pti); - IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED); - GreDeleteObject(Window->hrgnUpdate); - Window->state &= ~WNDS_UPDATEDIRTY; - Window->hrgnUpdate = NULL; - } - else - { - if (!(Window->state & WNDS_INTERNALPAINT)) - { - ERR("HAX WNDS_INTERNALPAINT not set! Dec Paint Count!\n"); - MsqDecPaintCountQueue(Window->head.pti); - } - } } BOOL FASTCALL Modified: trunk/reactos/win32ss/user/ntuser/simplecall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/simple…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] Mon Nov 28 16:48:39 2016 @@ -774,11 +774,8 @@ case TWOPARAM_ROUTINE_VALIDATERGN: { PREGION Rgn = REGION_LockRgn((HRGN)Param); - if (Rgn) - { - Ret = (DWORD)co_UserRedrawWindow( Window, NULL, Rgn, RDW_VALIDATE); - REGION_UnlockRgn(Rgn); - } + Ret = (DWORD)co_UserRedrawWindow( Window, NULL, Rgn, RDW_VALIDATE); + if (Rgn) REGION_UnlockRgn(Rgn); break; } }
8 years
1
0
0
0
[hbelusca] 73402: [SERVICES]: - Fix build. - Remove now deprecated code (since we use RPC for service commands since revision r13xxx).
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Nov 27 20:44:09 2016 New Revision: 73402 URL:
http://svn.reactos.org/svn/reactos?rev=73402&view=rev
Log: [SERVICES]: - Fix build. - Remove now deprecated code (since we use RPC for service commands since revision r13xxx). Modified: trunk/reactos/base/system/services/config.c trunk/reactos/base/system/services/services.c Modified: trunk/reactos/base/system/services/config.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/confi…
============================================================================== --- trunk/reactos/base/system/services/config.c [iso-8859-1] (original) +++ trunk/reactos/base/system/services/config.c [iso-8859-1] Sun Nov 27 20:44:09 2016 @@ -659,7 +659,7 @@ break; } - dwError = ScmDeleteServiceKey(hSubKey, pszName); + dwError = ScmDeleteRegKey(hSubKey, pszName); if (dwError != ERROR_SUCCESS) goto done; } Modified: trunk/reactos/base/system/services/services.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/servi…
============================================================================== --- trunk/reactos/base/system/services/services.c [iso-8859-1] (original) +++ trunk/reactos/base/system/services/services.c [iso-8859-1] Sun Nov 27 20:44:09 2016 @@ -21,9 +21,6 @@ /* GLOBALS ******************************************************************/ -#define PIPE_BUFSIZE 1024 -#define PIPE_TIMEOUT 1000 - /* Defined in include/reactos/services/services.h */ // #define SCM_START_EVENT L"SvcctrlStartEvent_A3752DX" #define SCM_AUTOSTARTCOMPLETE_EVENT L"SC_AutoStartComplete" @@ -105,182 +102,6 @@ } -BOOL -ScmNamedPipeHandleRequest(PVOID Request, - DWORD RequestSize, - PVOID Reply, - LPDWORD ReplySize) -{ - DbgPrint("SCM READ: %p\n", Request); - - *ReplySize = 0; - return FALSE; -} - - -DWORD WINAPI -ScmNamedPipeThread(LPVOID Context) -{ - CHAR chRequest[PIPE_BUFSIZE]; - CHAR chReply[PIPE_BUFSIZE]; - DWORD cbReplyBytes; - DWORD cbBytesRead; - DWORD cbWritten; - BOOL bSuccess; - HANDLE hPipe; - - hPipe = (HANDLE)Context; - - DPRINT("ScmNamedPipeThread(%p) - Accepting SCM commands through named pipe\n", hPipe); - - for (;;) - { - bSuccess = ReadFile(hPipe, - &chRequest, - PIPE_BUFSIZE, - &cbBytesRead, - NULL); - if (!bSuccess || cbBytesRead == 0) - { - break; - } - - if (ScmNamedPipeHandleRequest(&chRequest, cbBytesRead, &chReply, &cbReplyBytes)) - { - bSuccess = WriteFile(hPipe, - &chReply, - cbReplyBytes, - &cbWritten, - NULL); - if (!bSuccess || cbReplyBytes != cbWritten) - { - break; - } - } - } - - DPRINT("ScmNamedPipeThread(%p) - Disconnecting named pipe connection\n", hPipe); - - FlushFileBuffers(hPipe); - DisconnectNamedPipe(hPipe); - CloseHandle(hPipe); - - DPRINT("ScmNamedPipeThread(%p) - Done.\n", hPipe); - - return ERROR_SUCCESS; -} - - -BOOL -ScmCreateNamedPipe(VOID) -{ - DWORD dwThreadId; - BOOL bConnected; - HANDLE hThread; - HANDLE hPipe; - - DPRINT("ScmCreateNamedPipe() - CreateNamedPipe(\"\\\\.\\pipe\\Ntsvcs\")\n"); - - hPipe = CreateNamedPipeW(L"\\\\.\\pipe\\Ntsvcs", - PIPE_ACCESS_DUPLEX, - PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, - PIPE_BUFSIZE, - PIPE_BUFSIZE, - PIPE_TIMEOUT, - NULL); - if (hPipe == INVALID_HANDLE_VALUE) - { - DPRINT("CreateNamedPipe() failed (%lu)\n", GetLastError()); - return FALSE; - } - - DPRINT("CreateNamedPipe() - calling ConnectNamedPipe(%p)\n", hPipe); - bConnected = ConnectNamedPipe(hPipe, - NULL) ? TRUE : (GetLastError() == ERROR_PIPE_CONNECTED); - DPRINT("CreateNamedPipe() - ConnectNamedPipe() returned %d\n", bConnected); - - if (bConnected) - { - DPRINT("Pipe connected\n"); - hThread = CreateThread(NULL, - 0, - ScmNamedPipeThread, - (LPVOID)hPipe, - 0, - &dwThreadId); - if (!hThread) - { - DPRINT("Could not create thread (%lu)\n", GetLastError()); - DisconnectNamedPipe(hPipe); - CloseHandle(hPipe); - DPRINT("CreateNamedPipe() - returning FALSE\n"); - return FALSE; - } - - CloseHandle(hThread); - } - else - { - DPRINT("Pipe not connected\n"); - CloseHandle(hPipe); - DPRINT("CreateNamedPipe() - returning FALSE\n"); - return FALSE; - } - DPRINT("CreateNamedPipe() - returning TRUE\n"); - return TRUE; -} - - -DWORD WINAPI -ScmNamedPipeListenerThread(LPVOID Context) -{ -// HANDLE hPipe; - DPRINT("ScmNamedPipeListenerThread(%p) - aka SCM.\n", Context); - -// hPipe = (HANDLE)Context; - for (;;) - { - DPRINT("SCM: Waiting for new connection on named pipe...\n"); - /* Create named pipe */ - if (!ScmCreateNamedPipe()) - { - DPRINT1("\nSCM: Failed to create named pipe\n"); - break; - //ExitThread(0); - } - DPRINT("\nSCM: named pipe session created.\n"); - Sleep(10); - } - DPRINT("\n\nWARNING: ScmNamedPipeListenerThread(%p) - Aborted.\n\n", Context); - return ERROR_SUCCESS; -} - - -BOOL -StartScmNamedPipeThreadListener(VOID) -{ - DWORD dwThreadId; - HANDLE hThread; - - hThread = CreateThread(NULL, - 0, - ScmNamedPipeListenerThread, - NULL, /*(LPVOID)hPipe,*/ - 0, - &dwThreadId); - if (!hThread) - { - DPRINT1("SERVICES: Could not create thread (Status %lx)\n", GetLastError()); - return FALSE; - } - - CloseHandle(hThread); - - return TRUE; -} - - BOOL WINAPI ShutdownHandlerRoutine(DWORD dwCtrlType) {
8 years
1
0
0
0
[hbelusca] 73401: [SERVICES] - The new ScmDeleteServiceKey (r73400) and the already existing ScmDeleteRegKey are the same functions: remove the old ScmDeleteRegKey and use ScmDeleteServiceKey inste...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Nov 27 20:39:10 2016 New Revision: 73401 URL:
http://svn.reactos.org/svn/reactos?rev=73401&view=rev
Log: [SERVICES] - The new ScmDeleteServiceKey (r73400) and the already existing ScmDeleteRegKey are the same functions: remove the old ScmDeleteRegKey and use ScmDeleteServiceKey instead AND rename ScmDeleteServiceKey to ScmDeleteRegKey (as it can be used generically within services.exe). - Call RegDeleteKeyW for the subkey after we have closed its opened handle. Modified: trunk/reactos/base/system/services/config.c trunk/reactos/base/system/services/database.c trunk/reactos/base/system/services/rpcserver.c trunk/reactos/base/system/services/services.h Modified: trunk/reactos/base/system/services/config.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/confi…
============================================================================== --- trunk/reactos/base/system/services/config.c [iso-8859-1] (original) +++ trunk/reactos/base/system/services/config.c [iso-8859-1] Sun Nov 27 20:39:10 2016 @@ -617,22 +617,22 @@ DWORD -ScmDeleteServiceKey( - _In_ HKEY hServicesKey, - _In_ PCWSTR pszServiceName) +ScmDeleteRegKey( + _In_ HKEY hKey, + _In_ PCWSTR pszSubKey) { DWORD dwMaxSubkeyLen, dwMaxValueLen; DWORD dwMaxLen, dwSize; PWSTR pszName = NULL; - HKEY hServiceKey; + HKEY hSubKey; DWORD dwError; - dwError = RegOpenKeyExW(hServicesKey, pszServiceName, 0, KEY_READ, &hServiceKey); + dwError = RegOpenKeyExW(hKey, pszSubKey, 0, KEY_READ, &hSubKey); if (dwError != ERROR_SUCCESS) return dwError; /* Get maximum length of key and value names */ - dwError = RegQueryInfoKeyW(hServiceKey, NULL, NULL, NULL, NULL, + dwError = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL, &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL); if (dwError != ERROR_SUCCESS) goto done; @@ -653,22 +653,26 @@ while (TRUE) { dwSize = dwMaxLen; - if (RegEnumKeyExW(hServiceKey, 0, pszName, &dwSize, - NULL, NULL, NULL, NULL)) + if (RegEnumKeyExW(hSubKey, 0, pszName, &dwSize, + NULL, NULL, NULL, NULL) != ERROR_SUCCESS) + { break; - - dwError = ScmDeleteServiceKey(hServiceKey, pszName); + } + + dwError = ScmDeleteServiceKey(hSubKey, pszName); if (dwError != ERROR_SUCCESS) goto done; } - - dwError = RegDeleteKeyW(hServicesKey, pszServiceName); done: if (pszName != NULL) HeapFree(GetProcessHeap(), 0, pszName); - RegCloseKey(hServiceKey); + RegCloseKey(hSubKey); + + /* Finally delete the key */ + if (dwError == ERROR_SUCCESS) + dwError = RegDeleteKeyW(hKey, pszSubKey); return dwError; } Modified: trunk/reactos/base/system/services/database.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/datab…
============================================================================== --- trunk/reactos/base/system/services/database.c [iso-8859-1] (original) +++ trunk/reactos/base/system/services/database.c [iso-8859-1] Sun Nov 27 20:39:10 2016 @@ -735,55 +735,6 @@ } return dwError; -} - - -DWORD -ScmDeleteRegKey(HKEY hKey, LPCWSTR lpszSubKey) -{ - DWORD dwRet, dwMaxSubkeyLen = 0, dwSize; - WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf; - HKEY hSubKey = 0; - - dwRet = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey); - if (!dwRet) - { - /* Find the maximum subkey length so that we can allocate a buffer */ - dwRet = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL, - &dwMaxSubkeyLen, NULL, NULL, NULL, NULL, NULL, NULL); - if (!dwRet) - { - dwMaxSubkeyLen++; - if (dwMaxSubkeyLen > sizeof(szNameBuf) / sizeof(WCHAR)) - { - /* Name too big: alloc a buffer for it */ - lpszName = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwMaxSubkeyLen * sizeof(WCHAR)); - } - - if (!lpszName) - dwRet = ERROR_NOT_ENOUGH_MEMORY; - else - { - while (dwRet == ERROR_SUCCESS) - { - dwSize = dwMaxSubkeyLen; - dwRet = RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL, NULL, NULL, NULL); - if (dwRet == ERROR_SUCCESS || dwRet == ERROR_MORE_DATA) - dwRet = ScmDeleteRegKey(hSubKey, lpszName); - } - if (dwRet == ERROR_NO_MORE_ITEMS) - dwRet = ERROR_SUCCESS; - - if (lpszName != szNameBuf) - HeapFree(GetProcessHeap(), 0, lpszName); /* Free buffer if allocated */ - } - } - - RegCloseKey(hSubKey); - if (!dwRet) - dwRet = RegDeleteKeyW(hKey, lpszSubKey); - } - return dwRet; } Modified: trunk/reactos/base/system/services/rpcserver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/rpcse…
============================================================================== --- trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] (original) +++ trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] Sun Nov 27 20:39:10 2016 @@ -1026,8 +1026,8 @@ it is now safe to delete the service */ /* Delete the Service Key */ - dwError = ScmDeleteServiceKey(hServicesKey, - lpService->lpServiceName); + dwError = ScmDeleteRegKey(hServicesKey, + lpService->lpServiceName); RegCloseKey(hServicesKey); Modified: trunk/reactos/base/system/services/services.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/servi…
============================================================================== --- trunk/reactos/base/system/services/services.h [iso-8859-1] (original) +++ trunk/reactos/base/system/services/services.h [iso-8859-1] Sun Nov 27 20:39:10 2016 @@ -143,9 +143,9 @@ _Out_ PSECURITY_DESCRIPTOR *ppSecurityDescriptor); DWORD -ScmDeleteServiceKey( - _In_ HKEY hServicesKey, - _In_ PCWSTR pszServiceName); +ScmDeleteRegKey( + _In_ HKEY hKey, + _In_ PCWSTR pszSubKey); /* controlset.c */
8 years
1
0
0
0
← Newer
1
2
3
4
...
32
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
Results per page:
10
25
50
100
200