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
December 2011
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
16 participants
242 discussions
Start a n
N
ew thread
[rharabien] 54677: - Try to fix build
by rharabien@svn.reactos.org
Author: rharabien Date: Sat Dec 17 23:11:54 2011 New Revision: 54677 URL:
http://svn.reactos.org/svn/reactos?rev=54677&view=rev
Log: - Try to fix build Modified: trunk/reactos/include/reactos/debug.h Modified: trunk/reactos/include/reactos/debug.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/debug.h?re…
============================================================================== --- trunk/reactos/include/reactos/debug.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/debug.h [iso-8859-1] Sat Dec 17 23:11:54 2011 @@ -55,7 +55,7 @@ #ifndef assert #ifndef NASSERT -#define assert(x) if (!(x)) {RtlAssert("#x",__FILE__,__LINE__, ""); } +#define assert(x) if (!(x)) {RtlAssert((PVOID)#x,(PVOID)__FILE__,__LINE__, ""); } #else #define assert(x) #endif @@ -63,7 +63,7 @@ #ifndef ASSERT #ifndef NASSERT -#define ASSERT(x) if (!(x)) {RtlAssert("#x",__FILE__,__LINE__, ""); } +#define ASSERT(x) if (!(x)) {RtlAssert((PVOID)#x,(PVOID)__FILE__,__LINE__, ""); } #else #define ASSERT(x) #endif @@ -71,7 +71,7 @@ #ifndef ASSERTMSG #ifndef NASSERT -#define ASSERTMSG(x,m) if (!(x)) {RtlAssert("#x",__FILE__,__LINE__, m); } +#define ASSERTMSG(x,m) if (!(x)) {RtlAssert((PVOID)#x,__FILE__,__LINE__, m); } #else #define ASSERTMSG(x) #endif
13 years
1
0
0
0
[rharabien] 54676: [SHELL32] - Fix a typo from previous commit
by rharabien@svn.reactos.org
Author: rharabien Date: Sat Dec 17 22:57:01 2011 New Revision: 54676 URL:
http://svn.reactos.org/svn/reactos?rev=54676&view=rev
Log: [SHELL32] - Fix a typo from previous commit Modified: trunk/reactos/dll/win32/shell32/classes.cpp Modified: trunk/reactos/dll/win32/shell32/classes.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/classes.…
============================================================================== --- trunk/reactos/dll/win32/shell32/classes.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/classes.cpp [iso-8859-1] Sat Dec 17 22:57:01 2011 @@ -347,7 +347,7 @@ static const WCHAR wszLocalizedString[] = { 'L','o','c','a','l','i','z','e','d','S','t','r','i','n','g', 0 }; if (RegLoadMUIStringW(hkey, wszLocalizedString, szDest, len, NULL, 0, NULL) == ERROR_SUCCESS || - !RegQueryValueExW(hkey, swEmpty, 0, NULL, (LPBYTE)szDest, &len) == ERROR_SUCCESS) + RegQueryValueExW(hkey, swEmpty, 0, NULL, (LPBYTE)szDest, &len) == ERROR_SUCCESS) { ret = TRUE; }
13 years
1
0
0
0
[rharabien] 54675: [NDK] - Fix ASSERT macro
by rharabien@svn.reactos.org
Author: rharabien Date: Sat Dec 17 22:55:05 2011 New Revision: 54675 URL:
http://svn.reactos.org/svn/reactos?rev=54675&view=rev
Log: [NDK] - Fix ASSERT macro Modified: trunk/reactos/include/ndk/rtlfuncs.h Modified: trunk/reactos/include/ndk/rtlfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
============================================================================== --- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Sat Dec 17 22:55:05 2011 @@ -208,12 +208,12 @@ #define ASSERT( exp ) \ ((void)((!(exp)) ? \ - (RtlAssert( #exp, __FILE__, __LINE__, NULL ),FALSE) : \ + (RtlAssert( (PVOID)#exp, (PVOID)__FILE__, __LINE__, NULL ),FALSE) : \ TRUE)) #define ASSERTMSG( msg, exp ) \ ((void)((!(exp)) ? \ - (RtlAssert( #exp, __FILE__, __LINE__, msg ),FALSE) : \ + (RtlAssert( (PVOID)#exp, (PVOID)__FILE__, __LINE__, (PCHAR)msg ),FALSE) : \ TRUE)) #else
13 years
1
0
0
0
[rharabien] 54674: [SHELL32] - Formatting. No code changes - Remove not used shfldr_unixfs.cpp
by rharabien@svn.reactos.org
Author: rharabien Date: Sat Dec 17 22:53:44 2011 New Revision: 54674 URL:
http://svn.reactos.org/svn/reactos?rev=54674&view=rev
Log: [SHELL32] - Formatting. No code changes - Remove not used shfldr_unixfs.cpp Removed: trunk/reactos/dll/win32/shell32/shfldr_unixfs.cpp Modified: trunk/reactos/dll/win32/shell32/folder_options.cpp trunk/reactos/dll/win32/shell32/folders.cpp trunk/reactos/dll/win32/shell32/pidl.cpp trunk/reactos/dll/win32/shell32/pidl.h trunk/reactos/dll/win32/shell32/regsvr.c trunk/reactos/dll/win32/shell32/ros-systray.cpp trunk/reactos/dll/win32/shell32/she_ocmenu.cpp trunk/reactos/dll/win32/shell32/shfldr_admintools.cpp trunk/reactos/dll/win32/shell32/shfldr_cpanel.cpp trunk/reactos/dll/win32/shell32/shfldr_desktop.cpp trunk/reactos/dll/win32/shell32/shfldr_fonts.cpp trunk/reactos/dll/win32/shell32/shfldr_fs.cpp trunk/reactos/dll/win32/shell32/shfldr_mycomp.cpp trunk/reactos/dll/win32/shell32/shfldr_mydocuments.cpp trunk/reactos/dll/win32/shell32/shfldr_netplaces.cpp trunk/reactos/dll/win32/shell32/shfldr_printers.cpp trunk/reactos/dll/win32/shell32/shfldr_recyclebin.cpp trunk/reactos/dll/win32/shell32/shv_def_cmenu.cpp [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/shell32/folder_options.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folder_o…
Modified: trunk/reactos/dll/win32/shell32/folders.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders.…
Modified: trunk/reactos/dll/win32/shell32/pidl.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/pidl.cpp…
Modified: trunk/reactos/dll/win32/shell32/pidl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/pidl.h?r…
Modified: trunk/reactos/dll/win32/shell32/regsvr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/regsvr.c…
Modified: trunk/reactos/dll/win32/shell32/ros-systray.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/ros-syst…
Modified: trunk/reactos/dll/win32/shell32/she_ocmenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/she_ocme…
Modified: trunk/reactos/dll/win32/shell32/shfldr_admintools.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_a…
Modified: trunk/reactos/dll/win32/shell32/shfldr_cpanel.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_c…
Modified: trunk/reactos/dll/win32/shell32/shfldr_desktop.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_d…
Modified: trunk/reactos/dll/win32/shell32/shfldr_fonts.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_f…
Modified: trunk/reactos/dll/win32/shell32/shfldr_fs.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_f…
Modified: trunk/reactos/dll/win32/shell32/shfldr_mycomp.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_m…
Modified: trunk/reactos/dll/win32/shell32/shfldr_mydocuments.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_m…
Modified: trunk/reactos/dll/win32/shell32/shfldr_netplaces.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_n…
Modified: trunk/reactos/dll/win32/shell32/shfldr_printers.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_p…
Modified: trunk/reactos/dll/win32/shell32/shfldr_recyclebin.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_r…
Removed: trunk/reactos/dll/win32/shell32/shfldr_unixfs.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_u…
Modified: trunk/reactos/dll/win32/shell32/shv_def_cmenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_def_…
13 years
1
0
0
0
[rharabien] 54673: [SHELL32] - Revert 54075 hack (registration from old shell32 based on WINE), so things does not get registered twice. Two Control Panels in MyComputer are no longer visible - Fix...
by rharabien@svn.reactos.org
Author: rharabien Date: Sat Dec 17 22:48:16 2011 New Revision: 54673 URL:
http://svn.reactos.org/svn/reactos?rev=54673&view=rev
Log: [SHELL32] - Revert 54075 hack (registration from old shell32 based on WINE), so things does not get registered twice. Two Control Panels in MyComputer are no longer visible - Fix all regressions, which was hack-fixed before. - Add more debug output in case of errors Modified: trunk/reactos/dll/win32/shell32/classes.cpp trunk/reactos/dll/win32/shell32/pidl.cpp trunk/reactos/dll/win32/shell32/pidl.h trunk/reactos/dll/win32/shell32/res/rgs/controlpanel.rgs trunk/reactos/dll/win32/shell32/res/rgs/fontsfoldershortcut.rgs trunk/reactos/dll/win32/shell32/she_ocmenu.cpp trunk/reactos/dll/win32/shell32/shell32_main.cpp trunk/reactos/dll/win32/shell32/shfldr_admintools.cpp trunk/reactos/dll/win32/shell32/shfldr_cpanel.cpp trunk/reactos/dll/win32/shell32/shfldr_fonts.cpp trunk/reactos/dll/win32/shell32/shfldr_mycomp.cpp trunk/reactos/dll/win32/shell32/shfldr_printers.cpp trunk/reactos/dll/win32/shell32/shlfolder.cpp trunk/reactos/dll/win32/shell32/shlview.cpp trunk/reactos/dll/win32/shell32/shv_def_cmenu.cpp Modified: trunk/reactos/dll/win32/shell32/classes.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/classes.…
============================================================================== --- trunk/reactos/dll/win32/shell32/classes.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/classes.cpp [iso-8859-1] Sat Dec 17 22:48:16 2011 @@ -324,7 +324,7 @@ BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len) { - HKEY hkey; + HKEY hkey; BOOL ret = FALSE; DWORD buflen = len; WCHAR szName[100]; @@ -346,8 +346,8 @@ { static const WCHAR wszLocalizedString[] = { 'L','o','c','a','l','i','z','e','d','S','t','r','i','n','g', 0 }; - if (!RegLoadMUIStringW(hkey, wszLocalizedString, szDest, len, NULL, 0, NULL) || - !RegQueryValueExW(hkey, swEmpty, 0, NULL, (LPBYTE)szDest, &len)) + if (RegLoadMUIStringW(hkey, wszLocalizedString, szDest, len, NULL, 0, NULL) == ERROR_SUCCESS || + !RegQueryValueExW(hkey, swEmpty, 0, NULL, (LPBYTE)szDest, &len) == ERROR_SUCCESS) { ret = TRUE; } @@ -386,8 +386,8 @@ if(LoadStringW(shell32_hInstance, IDS_ADMINISTRATIVETOOLS, szDest, buflen)) ret = TRUE; } - - } + } + TRACE("-- %s\n", debugstr_w(szDest)); return ret; } Modified: trunk/reactos/dll/win32/shell32/pidl.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/pidl.cpp…
============================================================================== --- trunk/reactos/dll/win32/shell32/pidl.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/pidl.cpp [iso-8859-1] Sat Dec 17 22:48:16 2011 @@ -1222,11 +1222,17 @@ return FALSE; hr = SHBindToParent(pidl, IID_IShellFolder, (VOID**)&psfFolder, &pidlLast); - if (FAILED(hr)) return FALSE; + if (FAILED(hr)) + { + ERR("SHBindToParent failed: %x\n", hr); + return FALSE; + } dwAttributes = SFGAO_FILESYSTEM; hr = psfFolder->GetAttributesOf(1, &pidlLast, &dwAttributes); - if (FAILED(hr) || !(dwAttributes & SFGAO_FILESYSTEM)) { + if (FAILED(hr) || !(dwAttributes & SFGAO_FILESYSTEM)) + { + WARN("Wrong dwAttributes or GetAttributesOf failed: %x\n", hr); return FALSE; } @@ -1592,7 +1598,7 @@ { TRACE("(%p)\n",pidl); - return pidl && pidl->mkid.cb ? 0 : 1; + return pidl && pidl->mkid.cb ? 0 : 1; } BOOL _ILIsMyDocuments(LPCITEMIDLIST pidl) Modified: trunk/reactos/dll/win32/shell32/pidl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/pidl.h?r…
============================================================================== --- trunk/reactos/dll/win32/shell32/pidl.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/pidl.h [iso-8859-1] Sat Dec 17 22:48:16 2011 @@ -104,6 +104,7 @@ #define PT_NETWORK 0x47 #define PT_IESPECIAL1 0x61 #define PT_YAGUID 0x70 /* yet another guid.. */ +#define PT_CPEXT 0x71 #define PT_IESPECIAL2 0xb1 #define PT_SHARE 0xc3 Modified: trunk/reactos/dll/win32/shell32/res/rgs/controlpanel.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/rgs/…
============================================================================== --- trunk/reactos/dll/win32/shell32/res/rgs/controlpanel.rgs [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/res/rgs/controlpanel.rgs [iso-8859-1] Sat Dec 17 22:48:16 2011 @@ -2,7 +2,7 @@ { NoRemove CLSID { - ForceRemove {21EC2020-3AEA-1069-A2DD-08002B30309D} + ForceRemove {21EC2020-3AEA-1069-A2DD-08002B30309D} = s 'Control Panel' { val InfoTip = e '@%%SystemRoot%%\system32\SHELL32.dll,-31361' DefaultIcon = e '%%SystemRoot%%\System32\shell32.dll,-137' @@ -12,7 +12,7 @@ } ShellFolder { - val Attributes = d '0' + val Attributes = d '&H00000000' val HideAsDeletePerUser = s '' val WantsFORDISPLAY = s '' } Modified: trunk/reactos/dll/win32/shell32/res/rgs/fontsfoldershortcut.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/rgs/…
============================================================================== --- trunk/reactos/dll/win32/shell32/res/rgs/fontsfoldershortcut.rgs [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/res/rgs/fontsfoldershortcut.rgs [iso-8859-1] Sat Dec 17 22:48:16 2011 @@ -23,7 +23,7 @@ } 'ShellFolder' { - val Attributes = d '&H60000100' + val Attributes = d '&H60000000' val WantsFORPARSING = s '' } } Modified: trunk/reactos/dll/win32/shell32/she_ocmenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/she_ocme…
============================================================================== --- trunk/reactos/dll/win32/shell32/she_ocmenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/she_ocmenu.cpp [iso-8859-1] Sat Dec 17 22:48:16 2011 @@ -153,12 +153,11 @@ HMENU hSubMenu = NULL; OPEN_WITH_CONTEXT Context; - if (LoadStringW(shell32_hInstance, IDS_OPEN_WITH, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)) < 0) - { - TRACE("failed to load string\n"); + if (!LoadStringW(shell32_hInstance, IDS_OPEN_WITH, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) + { + ERR("failed to load string\n"); return E_FAIL; } - szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; hSubMenu = CreatePopupMenu(); @@ -798,7 +797,7 @@ MENUITEMINFOW mii; POPEN_ITEM_CONTEXT pItemContext; LRESULT index; - WCHAR * Offset; + WCHAR *pwszExt; WCHAR Buffer[_MAX_FNAME]; pItemContext = (OPEN_ITEM_CONTEXT *)HeapAlloc(GetProcessHeap(), 0, sizeof(OPEN_ITEM_CONTEXT)); @@ -807,13 +806,11 @@ /* store app path */ wcscpy(pItemContext->szAppName, szAppName); - /* null terminate it */ - pItemContext->szAppName[MAX_PATH-1] = 0; /* extract path name */ _wsplitpath(szAppName, NULL, NULL, Buffer, NULL); - Offset = wcsrchr(Buffer, '.'); - if (Offset) - Offset[0] = L'\0'; + pwszExt = wcsrchr(Buffer, '.'); + if (pwszExt) + pwszExt[0] = L'\0'; Buffer[0] = towupper(Buffer[0]); if (pContext->bMenu) @@ -840,7 +837,7 @@ pItemContext->hIcon = ExtractIconW(shell32_hInstance, szAppName, 0); /* get manufacturer */ GetManufacturer(pItemContext->szAppName, pItemContext); - index = SendMessageW(pContext->hDlgCtrl, LB_ADDSTRING, 0, (LPARAM)Buffer); + index = SendMessageW(pContext->hDlgCtrl, LB_ADDSTRING, 0, (LPARAM)Buffer); if (index != LB_ERR) SendMessageW(pContext->hDlgCtrl, LB_SETITEMDATA, index, (LPARAM)pItemContext); } @@ -879,7 +876,10 @@ /* open mru list */ hList = OpenMRUList(hKey); if (!hList) - return; + { + ERR("OpenMRUList failed\n"); + return; + } /* get list count */ nCount = EnumMRUListW(hList, -1, NULL, 0); @@ -933,11 +933,11 @@ if (RegGetValueW(hSubKey, NULL, NULL, RRF_RT_REG_SZ, NULL, (PVOID)szBuffer, &dwBuffer) == ERROR_SUCCESS) { - WCHAR * Ext = wcsrchr(szBuffer, ' '); - if (Ext) + WCHAR * pszSpace = wcsrchr(szBuffer, ' '); + if (pszSpace) { /* erase %1 or extra arguments */ - Ext[0] = 0; + *pszSpace = 0; // FIXME: what about '"' } if(!HideApplicationFromList(szBuffer)) InsertOpenWithItem(pContext, szBuffer); @@ -1022,8 +1022,8 @@ LPCITEMIDLIST pidl_folder; LPCITEMIDLIST pidl_child; LPCITEMIDLIST pidl; - DWORD dwPath; - LPWSTR szPtr; + DWORD dwType; + LPWSTR pszExt; static const WCHAR szShortCut[] = { '.','l','n','k', 0 }; fmt.cfFormat = RegisterClipboardFormatW(CFSTR_SHELLIDLIST); @@ -1040,11 +1040,11 @@ return hr; } - /*assert(pida->cidl==1);*/ pida = (LPIDA)GlobalLock(medium.hGlobal); - - pidl_folder = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]); - pidl_child = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[1]); + ASSERT(pida->cidl==1); + + pidl_folder = (LPCITEMIDLIST) ((LPBYTE)pida + pida->aoffset[0]); + pidl_child = (LPCITEMIDLIST) ((LPBYTE)pida + pida->aoffset[1]); pidl = ILCombine(pidl_folder, pidl_child); @@ -1057,7 +1057,7 @@ return E_OUTOFMEMORY; } if (_ILIsDesktop(pidl) || _ILIsMyDocuments(pidl) || _ILIsControlPanel(pidl) || _ILIsNetHood(pidl) || - _ILIsBitBucket(pidl) || _ILIsDrive(pidl) || _ILIsCPanelStruct(pidl) || _ILIsFolder(pidl) || _ILIsControlPanel(pidl)) + _ILIsBitBucket(pidl) || _ILIsDrive(pidl) || _ILIsCPanelStruct(pidl) || _ILIsFolder(pidl)) { TRACE("pidl is a folder\n"); SHFree((void*)pidl); @@ -1066,35 +1066,35 @@ if (!SHGetPathFromIDListW(pidl, szPath)) { + IID *iid = _ILGetGUIDPointer(pidl); SHFree((void*)pidl); - ERR("SHGetPathFromIDListW failed\n"); + ERR("SHGetPathFromIDListW failed %s\n", iid ? shdebugstr_guid(iid) : ""); return E_FAIL; } - + SHFree((void*)pidl); TRACE("szPath %s\n", debugstr_w(szPath)); - if (GetBinaryTypeW(szPath, &dwPath)) - { - TRACE("path is a executable %x\n", dwPath); + if (GetBinaryTypeW(szPath, &dwType)) + { + TRACE("path is a executable %x\n", dwType); return E_FAIL; } - szPtr = wcsrchr(szPath, '.'); - if (szPtr) - { - if (!_wcsicmp(szPtr, szShortCut)) - { - FIXME("pidl is a shortcut\n"); - return E_FAIL; - } - } + pszExt = wcsrchr(szPath, L'.'); + if (pszExt && !_wcsicmp(pszExt, szShortCut)) + { + FIXME("pidl is a shortcut\n"); + return E_FAIL; + } + return S_OK; } HRESULT WINAPI COpenWithMenu::Initialize(LPCITEMIDLIST pidlFolder, - IDataObject *pdtobj, HKEY hkeyProgID ) + IDataObject *pdtobj, + HKEY hkeyProgID) { TRACE("This %p\n", this); @@ -1103,10 +1103,9 @@ return SHEOW_LoadOpenWithItems(pdtobj); } -HRESULT WINAPI SHOpenWithDialog( - HWND hwndParent, - const OPENASINFO *poainfo -) +HRESULT WINAPI +SHOpenWithDialog(HWND hwndParent, + const OPENASINFO *poainfo) { MSG msg; BOOL bRet; Modified: trunk/reactos/dll/win32/shell32/shell32_main.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32_…
============================================================================== --- trunk/reactos/dll/win32/shell32/shell32_main.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shell32_main.cpp [iso-8859-1] Sat Dec 17 22:48:16 2011 @@ -1462,8 +1462,11 @@ if (FAILED(hr)) return hr; - // extra registration stuff for the IShellFolder - return DoRegisterServer(); + hr = SHELL_RegisterShellFolders(); + if (FAILED(hr)) + return hr; + + return S_OK; } /*********************************************************************** @@ -1481,8 +1484,7 @@ if (FAILED(hr)) return hr; - // extra stuff which is performed for IShellFolder - return DoUnregisterServer(); + return S_OK; } /************************************************************************* Modified: trunk/reactos/dll/win32/shell32/shfldr_admintools.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_a…
============================================================================== --- trunk/reactos/dll/win32/shell32/shfldr_admintools.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shfldr_admintools.cpp [iso-8859-1] Sat Dec 17 22:48:16 2011 @@ -365,9 +365,9 @@ if (!pszPath) return E_OUTOFMEMORY; - ZeroMemory(pszPath, (MAX_PATH +1) * sizeof(WCHAR)); - - if (_ILIsAdminTools (pidl)) + ZeroMemory(pszPath, (MAX_PATH + 1) * sizeof(WCHAR)); + + if (!pidl->mkid.cb) { if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && (GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING)) Modified: trunk/reactos/dll/win32/shell32/shfldr_cpanel.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_c…
============================================================================== --- trunk/reactos/dll/win32/shell32/shfldr_cpanel.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shfldr_cpanel.cpp [iso-8859-1] Sat Dec 17 22:48:16 2011 @@ -480,13 +480,14 @@ return E_INVALIDARG; if (*rgfInOut == 0) - *rgfInOut = ~0; - - while(cidl > 0 && *apidl) { - pdump(*apidl); - SHELL32_GetItemAttributes(this, *apidl, rgfInOut); - apidl++; - cidl--; + *rgfInOut = ~0; + + while(cidl > 0 && *apidl) + { + pdump(*apidl); + SHELL32_GetItemAttributes(this, *apidl, rgfInOut); + apidl++; + cidl--; } /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */ *rgfInOut &= ~SFGAO_VALIDATE; @@ -567,14 +568,15 @@ CHAR szName[MAX_PATH]; WCHAR wszName[MAX_PATH+1]; /* +1 for potential backslash */ PIDLCPanelStruct *pCPanel; + HRESULT hr; *szName = '\0'; TRACE("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet); pdump(pidl); - if (!pidl || !strRet) - return E_INVALIDARG; + if (!pidl) + return S_FALSE; pCPanel = _ILGetCPanelPointer(pidl); @@ -588,38 +590,38 @@ else if (_ILIsSpecialFolder(pidl)) { BOOL bSimplePidl = _ILIsPidlSimple(pidl); - - if (bSimplePidl) + SFGAOF Attr = SFGAO_FILESYSTEM; + + SHELL32_GetItemAttributes(this, pidl, &Attr); + if (Attr & SFGAO_FILESYSTEM) + { + hr = SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, wszName, sizeof(wszName)); + if (FAILED(hr)) + return hr; + } + else if (bSimplePidl) { _ILSimpleGetTextW(pidl, wszName, MAX_PATH); /* append my own path */ } else { FIXME("special pidl\n"); - } - - if ((dwFlags & SHGDN_FORPARSING) && !bSimplePidl) - { - /* go deeper if needed */ - int len = 0; - - PathAddBackslashW(wszName); - len = wcslen(wszName); - - if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, wszName + len, MAX_PATH + 1 - len))) - return E_OUTOFMEMORY; - - if (!WideCharToMultiByte(CP_ACP, 0, wszName, -1, szName, MAX_PATH, NULL, NULL)) - wszName[0] = '\0'; - } - else - { - if (bSimplePidl) + if (dwFlags & SHGDN_FORPARSING) { - if (!WideCharToMultiByte(CP_ACP, 0, wszName, -1, szName, MAX_PATH, NULL, NULL)) - wszName[0] = '\0'; + /* go deeper if needed */ + int cchName; + + PathAddBackslashW(wszName); + cchName = wcslen(wszName); + + hr = SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, wszName + cchName, MAX_PATH + 1 - cchName); + if (FAILED(hr)) + return hr; } } + + if (!WideCharToMultiByte(CP_ACP, 0, wszName, -1, szName, MAX_PATH, NULL, NULL)) + szName[0] = '\0'; } strRet->uType = STRRET_CSTR; @@ -796,14 +798,9 @@ dwSize = sizeof(szCmd); if (RegGetValueW(HKEY_CLASSES_ROOT, szBuffer, NULL, RRF_RT_REG_SZ, &dwType, (PVOID)szCmd, &dwSize) != ERROR_SUCCESS) { - ERR("RegGetValueW failed with %u\n", GetLastError()); + ERR("RegGetValueW(%ls) failed with %u\n", szBuffer, GetLastError()); return E_FAIL; } - -#if 0 - if (dwType != RRF_RT_REG_SZ && dwType != RRF_RT_REG_EXPAND_SZ) - return E_FAIL; -#endif if (!ExpandEnvironmentStringsW(szCmd, szExpCmd, sizeof(szExpCmd)/sizeof(WCHAR))) return E_FAIL; @@ -846,7 +843,6 @@ return E_INVALIDARG; if (StringFromCLSID(*iid, &pOleStr) == S_OK) { - hr = ExecuteAppletFromCLSID(pOleStr); CoTaskMemFree(pOleStr); return hr; Modified: trunk/reactos/dll/win32/shell32/shfldr_fonts.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_f…
============================================================================== --- trunk/reactos/dll/win32/shell32/shfldr_fonts.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shfldr_fonts.cpp [iso-8859-1] Sat Dec 17 22:48:16 2011 @@ -436,7 +436,7 @@ */ HRESULT WINAPI CFontsFolder::GetDisplayNameOf(LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet) { - PIDLFontStruct * pfont; + PIDLFontStruct *pFont; TRACE("ISF_Fonts_fnGetDisplayNameOf (%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet); pdump (pidl); @@ -444,16 +444,38 @@ if (!strRet) return E_INVALIDARG; - pfont = _ILGetFontStruct(pidl); - if (!pfont) + pFont = _ILGetFontStruct(pidl); + if (pFont) + { + strRet->pOleStr = (LPWSTR)CoTaskMemAlloc((wcslen(pFont->szName)+1) * sizeof(WCHAR)); + if (!strRet->pOleStr) + return E_OUTOFMEMORY; + + wcscpy(strRet->pOleStr, pFont->szName); + strRet->uType = STRRET_WSTR; + } + else if (!pidl->mkid.cb) + { + WCHAR wszPath[MAX_PATH]; + + if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && + (GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING)) + { + if (!SHGetSpecialFolderPathW(NULL, wszPath, CSIDL_FONTS, FALSE)) + return E_FAIL; + } + else if (!HCR_GetClassNameW(CLSID_FontsFolderShortcut, wszPath, MAX_PATH)) + return E_FAIL; + + strRet->pOleStr = (LPWSTR)CoTaskMemAlloc((wcslen(wszPath) + 1) * sizeof(WCHAR)); + if (!strRet->pOleStr) + return E_OUTOFMEMORY; + + wcscpy(strRet->pOleStr, wszPath); + strRet->uType = STRRET_WSTR; + } + else return E_INVALIDARG; - - strRet->pOleStr = (LPWSTR)CoTaskMemAlloc((wcslen(pfont->szName)+1) * sizeof(WCHAR)); - if (!strRet->pOleStr) - return E_OUTOFMEMORY; - - wcscpy(strRet->pOleStr, pfont->szName); - strRet->uType = STRRET_WSTR; return S_OK; } Modified: trunk/reactos/dll/win32/shell32/shfldr_mycomp.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_m…
============================================================================== --- trunk/reactos/dll/win32/shell32/shfldr_mycomp.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shfldr_mycomp.cpp [iso-8859-1] Sat Dec 17 22:48:16 2011 @@ -136,11 +136,12 @@ RegGetValueW(hKey, wszBuf, NULL, RRF_RT_REG_SZ, NULL, wszBuf, &dwSize); } - /* FIXME: shell extensions, shouldn't the type be - * PT_SHELLEXT? */ + /* FIXME: shell extensions - the type should be PT_SHELLEXT (tested) */ pidl = _ILCreateGuidFromStrW(wszBuf); if (pidl != NULL) bRet = AddToEnumList(pidl); + else + ERR("Invalid MyComputer namespace extesion: %s\n", wszBuf); j++; } else if (ERROR_NO_MORE_ITEMS == ErrorCode) @@ -171,17 +172,19 @@ { DWORD dwSize; WCHAR szName[MAX_PATH]; + WCHAR wszMyCompKey[256]; + INT i; pidlRoot = _ILCreateMyComputer(); /* my qualified pidl */ if (pidlRoot == NULL) return E_OUTOFMEMORY; + i = swprintf(wszMyCompKey, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\"); + StringFromGUID2(CLSID_MyComputer, wszMyCompKey + i, sizeof(wszMyCompKey)/sizeof(wszMyCompKey[0]) - i); dwSize = sizeof(szName); - if (RegGetValueW(HKEY_CURRENT_USER, - L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\{20D04FE0-3AEA-1069-A2D8-08002B30309D}", + if (RegGetValueW(HKEY_CURRENT_USER, wszMyCompKey, NULL, RRF_RT_REG_SZ, NULL, szName, &dwSize) == ERROR_SUCCESS) { - szName[MAX_PATH - 1] = 0; sName = (LPWSTR)SHAlloc((wcslen(szName) + 1) * sizeof(WCHAR)); if (sName) { @@ -384,10 +387,12 @@ if (*rgfInOut == 0) *rgfInOut = ~0; - if(cidl == 0) { + if(cidl == 0) *rgfInOut &= dwComputerAttributes; - } else { - while (cidl > 0 && *apidl) { + else + { + while (cidl > 0 && *apidl) + { pdump (*apidl); SHELL32_GetItemAttributes (this, *apidl, rgfInOut); apidl++; Modified: trunk/reactos/dll/win32/shell32/shfldr_printers.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_p…
============================================================================== --- trunk/reactos/dll/win32/shell32/shfldr_printers.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shfldr_printers.cpp [iso-8859-1] Sat Dec 17 22:48:16 2011 @@ -561,7 +561,7 @@ return E_INVALIDARG; } - if (_ILIsPrinter(pidl)) + if (!pidl->mkid.cb) { pszName = (LPWSTR)CoTaskMemAlloc(MAX_PATH * sizeof(WCHAR)); if (!pszName) Modified: trunk/reactos/dll/win32/shell32/shlfolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfolde…
============================================================================== --- trunk/reactos/dll/win32/shell32/shlfolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shlfolder.cpp [iso-8859-1] Sat Dec 17 22:48:16 2011 @@ -318,25 +318,28 @@ TRACE ("(%p)->(pidl=%p 0x%08x %p 0x%08x)\n", psf, pidl, dwFlags, szOut, dwOutLen); pdump (pidl); - pidlFirst = ILCloneFirst (pidl); - if (pidlFirst) { - IShellFolder2 *psfChild; - - hr = psf->BindToObject(pidlFirst, NULL, IID_IShellFolder, (LPVOID *) & psfChild); - if (SUCCEEDED (hr)) { - STRRET strTemp; - LPITEMIDLIST pidlNext = ILGetNext (pidl); - - hr = psfChild->GetDisplayNameOf(pidlNext, dwFlags, &strTemp); - if (SUCCEEDED (hr)) { - if(!StrRetToStrNW (szOut, dwOutLen, &strTemp, pidlNext)) + pidlFirst = ILCloneFirst(pidl); + if (pidlFirst) + { + IShellFolder *psfChild; + + hr = psf->BindToObject(pidlFirst, NULL, IID_IShellFolder, (LPVOID *) & psfChild); + if (SUCCEEDED (hr)) + { + STRRET strTemp; + LPITEMIDLIST pidlNext = ILGetNext (pidl); + + hr = psfChild->GetDisplayNameOf(pidlNext, dwFlags, &strTemp); + if (SUCCEEDED (hr)) + { + if(!StrRetToStrNW (szOut, dwOutLen, &strTemp, pidlNext)) hr = E_FAIL; - } - psfChild->Release(); - } - ILFree (pidlFirst); + } + psfChild->Release(); + } + ILFree (pidlFirst); } else - hr = E_OUTOFMEMORY; + hr = E_OUTOFMEMORY; TRACE ("-- ret=0x%08x %s\n", hr, debugstr_w(szOut)); @@ -394,13 +397,20 @@ dwAttributes = *pdwAttributes; - if (_ILIsDrive (pidl)) { + /* Attributes of some special folders are hardcoded */ + if (_ILIsDrive(pidl)) { *pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FILESYSTEM|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR| - SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANRENAME; + SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANRENAME; + } else if (_ILIsMyComputer(pidl) || _ILIsNetHood(pidl)) { + *pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR| + SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANDELETE| + SFGAO_CANRENAME|SFGAO_CANLINK; + } else if (_ILIsControlPanel(pidl)) { + *pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FOLDER|SFGAO_CANLINK; } else if (has_guid && HCR_GetFolderAttributes(pidl, &dwAttributes)) { - *pdwAttributes = dwAttributes; - } else if (_ILGetDataPointer (pidl)) { - dwAttributes = _ILGetFileAttributes (pidl, NULL, 0); + *pdwAttributes = dwAttributes; + } else if (_ILGetDataPointer(pidl)) { + dwAttributes = _ILGetFileAttributes(pidl, NULL, 0); if (!dwAttributes && has_guid) { WCHAR path[MAX_PATH]; @@ -419,9 +429,9 @@ } } - /* Set common attributes */ - *pdwAttributes |= SFGAO_FILESYSTEM | SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANDELETE | - SFGAO_CANRENAME | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANCOPY; + /* Set common attributes */ + *pdwAttributes |= SFGAO_FILESYSTEM | SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANDELETE | + SFGAO_CANRENAME | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANCOPY; if (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) { Modified: trunk/reactos/dll/win32/shell32/shlview.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlview.…
============================================================================== --- trunk/reactos/dll/win32/shell32/shlview.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shlview.cpp [iso-8859-1] Sat Dec 17 22:48:16 2011 @@ -1131,13 +1131,18 @@ ici.lpVerb = MAKEINTRESOURCEA( def ); ici.hwnd = m_hWnd; - if (cm->InvokeCommand((LPCMINVOKECOMMANDINFO) &ici ) == S_OK) + hr = cm->InvokeCommand((LPCMINVOKECOMMANDINFO)&ici); + if (hr == S_OK) { - DestroyMenu( hmenu ); + DestroyMenu(hmenu); hr = IUnknown_SetSite(cm, NULL); return S_OK; } + else + ERR("InvokeCommand failed: %x\n", hr); } + else + ERR("No default context menu item\n"); } DestroyMenu( hmenu ); @@ -1160,7 +1165,7 @@ { CF_IDLIST = RegisterClipboardFormatW(CFSTR_SHELLIDLIST); } - + fetc.cfFormat = CF_IDLIST; fetc.ptd = NULL; fetc.dwAspect = DVASPECT_CONTENT; Modified: trunk/reactos/dll/win32/shell32/shv_def_cmenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_def_…
============================================================================== --- trunk/reactos/dll/win32/shell32/shv_def_cmenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shv_def_cmenu.cpp [iso-8859-1] Sat Dec 17 22:48:16 2011 @@ -309,6 +309,7 @@ return ret; } +static VOID DisablePasteOptions(HMENU hMenu) { @@ -338,28 +339,25 @@ HRESULT -IDefaultContextMenuImpl::SH_LoadDynamicContextMenuHandler(HKEY hKey, const CLSID * szClass, BOOL bExternalInit) +IDefaultContextMenuImpl::SH_LoadDynamicContextMenuHandler(HKEY hKey, const CLSID * pClass, BOOL bExternalInit) { HRESULT hr; IContextMenu * cmobj; IShellExtInit *shext; PDynamicShellEntry curEntry; - //WCHAR szTemp[100]; LPOLESTR pstr; - StringFromCLSID(*szClass, &pstr); - - TRACE("SH_LoadDynamicContextMenuHandler entered with This %p hKey %p szClass %s bExternalInit %u\n",this, hKey, wine_dbgstr_guid(szClass), bExternalInit); - //swprintf(szTemp, L"This %p hKey %p szClass %s bExternalInit %u", this, hKey, pstr, bExternalInit); - //MessageBoxW(NULL, szTemp, NULL, MB_OK); - - if (IsShellExtensionAlreadyLoaded(szClass)) + StringFromCLSID(*pClass, &pstr); + + TRACE("SH_LoadDynamicContextMenuHandler entered with This %p hKey %p pClass %s bExternalInit %u\n", this, hKey, wine_dbgstr_guid(pClass), bExternalInit); + + if (IsShellExtensionAlreadyLoaded(pClass)) return S_OK; - hr = SHCoCreateInstance(NULL, szClass, NULL, IID_IContextMenu, (void**)&cmobj); + hr = SHCoCreateInstance(NULL, pClass, NULL, IID_IContextMenu, (void**)&cmobj); if (hr != S_OK) { - TRACE("SHCoCreateInstance failed %x\n", GetLastError()); + ERR("SHCoCreateInstance failed %x\n", GetLastError()); return hr; } @@ -368,7 +366,7 @@ hr = cmobj->QueryInterface(IID_IShellExtInit, (void**)&shext); if (hr != S_OK) { - TRACE("Failed to query for interface IID_IShellExtInit\n"); + ERR("Failed to query for interface IID_IShellExtInit hr %x pClass %s\n", hr, wine_dbgstr_guid(pClass)); cmobj->Release(); return FALSE; } @@ -376,7 +374,7 @@ shext->Release(); if (hr != S_OK) { - TRACE("Failed to initialize shell extension error %x\n", hr); + TRACE("Failed to initialize shell extension error %x pClass %s\n", hr, wine_dbgstr_guid(pClass)); cmobj->Release(); return hr; } @@ -393,7 +391,7 @@ curEntry->Next = NULL; curEntry->NumIds = 0; curEntry->CMenu = cmobj; - memcpy(&curEntry->ClassID, szClass, sizeof(CLSID)); + memcpy(&curEntry->ClassID, pClass, sizeof(CLSID)); if (dhead) { @@ -660,7 +658,7 @@ } else { - TRACE("Failed to load string, defaulting to NULL value for mii.dwTypeData\n"); + ERR("Failed to load string, defaulting to NULL value for mii.dwTypeData\n"); } } else @@ -728,7 +726,7 @@ } else { - TRACE("failed to load string %p\n", dwTypeData); + ERR("failed to load string %p\n", dwTypeData); return; } } @@ -766,9 +764,11 @@ TRACE("BuildShellItemContextMenu entered\n"); - if (dcm.psf->GetDisplayNameOf(dcm.apidl[0], SHGDN_FORPARSING, &strFile) == S_OK) - { - if (StrRetToBufW(&strFile, dcm.apidl[0], szPath, MAX_PATH) == S_OK) + hr = dcm.psf->GetDisplayNameOf(dcm.apidl[0], SHGDN_FORPARSING, &strFile); + if (hr == S_OK) + { + hr = StrRetToBufW(&strFile, dcm.apidl[0], szPath, MAX_PATH); + if (hr == S_OK) { pOffset = wcsrchr(szPath, L'.'); if (pOffset) @@ -803,6 +803,8 @@ } } } + else + ERR("GetDisplayNameOf failed: %x\n", hr); guid = _ILGetGUIDPointer(dcm.apidl[0]); if (guid) @@ -841,10 +843,13 @@ /* add static actions */ rfg = SFGAO_BROWSABLE | SFGAO_CANCOPY | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANDELETE | SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_FILESYSTEM | SFGAO_FOLDER; hr = dcm.psf->GetAttributesOf(dcm.cidl, dcm.apidl, &rfg); - if (!SUCCEEDED(hr)) + if (FAILED(hr)) + { + WARN("GetAttributesOf failed: %x\n", hr); rfg = 0; - - if (rfg & SFGAO_FOLDER) + } + + if ((rfg & SFGAO_FOLDER) || _ILIsControlPanel(dcm.apidl[dcm.cidl])) { /* add the default verbs open / explore */ SH_AddStaticEntryForFileClass(L"Folder"); @@ -1156,8 +1161,7 @@ IDefaultContextMenuImpl::DoOpenOrExplore( LPCMINVOKECOMMANDINFO lpcmi) { - - + UNIMPLEMENTED; return E_FAIL; } @@ -1450,7 +1454,7 @@ { //FIXME path! ShellExecuteW(NULL, L"open", L"explorer.exe", - L"/n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}", + L"::{7007ACC7-3202-11D1-AAD2-00805FC1270E}", NULL, SW_SHOWDEFAULT); return S_OK; } @@ -1697,7 +1701,7 @@ *ppv = NULL; hr = IDefaultContextMenu_Constructor( pdcm, riid, ppv ); - + if (FAILED(hr)) WARN("IDefaultContextMenu_Constructor failed: %x\n", hr); TRACE("pcm %p hr %x\n", pdcm, hr); return hr; }
13 years
1
0
0
0
[ekohl] 54672: [EVENTLOG] - Implement ElfrReadELA. - Improve LogfReadEvent in such a way that it can return ANSI and UNICODE log entries. - Add a hack to ElfrReadELW in order to return a proper sta...
by ekohl@svn.reactos.org
Author: ekohl Date: Sat Dec 17 13:22:10 2011 New Revision: 54672 URL:
http://svn.reactos.org/svn/reactos?rev=54672&view=rev
Log: [EVENTLOG] - Implement ElfrReadELA. - Improve LogfReadEvent in such a way that it can return ANSI and UNICODE log entries. - Add a hack to ElfrReadELW in order to return a proper status code in case of an end-of-file situation. Modified: trunk/reactos/base/services/eventlog/eventlog.h trunk/reactos/base/services/eventlog/file.c trunk/reactos/base/services/eventlog/rpc.c Modified: trunk/reactos/base/services/eventlog/eventlog.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/eve…
============================================================================== --- trunk/reactos/base/services/eventlog/eventlog.h [iso-8859-1] (original) +++ trunk/reactos/base/services/eventlog/eventlog.h [iso-8859-1] Sat Dec 17 13:22:10 2011 @@ -134,7 +134,8 @@ DWORD BufSize, PBYTE Buffer, DWORD * BytesRead, - DWORD * BytesNeeded); + DWORD * BytesNeeded, + BOOL Ansi); BOOL LogfWriteData(PLOGFILE LogFile, DWORD BufSize, Modified: trunk/reactos/base/services/eventlog/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/fil…
============================================================================== --- trunk/reactos/base/services/eventlog/file.c [iso-8859-1] (original) +++ trunk/reactos/base/services/eventlog/file.c [iso-8859-1] Sat Dec 17 13:22:10 2011 @@ -511,7 +511,7 @@ return Result; } -INT LogfListItemCount() +INT LogfListItemCount(VOID) { PLIST_ENTRY CurrentEntry; INT i = 0; @@ -542,6 +542,163 @@ RemoveEntryList(&Item->ListEntry); LeaveCriticalSection(&LogFileListCs); } + +static BOOL +ReadAnsiLogEntry(HANDLE hFile, + LPVOID lpBuffer, + DWORD nNumberOfBytesToRead, + LPDWORD lpNumberOfBytesRead) +{ + PEVENTLOGRECORD Dst; + PEVENTLOGRECORD Src; + ANSI_STRING StringA; + UNICODE_STRING StringW; + LPWSTR SrcPtr; + LPSTR DstPtr; + LPWSTR SrcString; + LPSTR DstString; + LPVOID lpUnicodeBuffer = NULL; + DWORD dwRead = 0; + DWORD i; + DWORD dwPadding; + DWORD dwEntryLength; + PDWORD pLength; + NTSTATUS Status; + BOOL ret = TRUE; + + *lpNumberOfBytesRead = 0; + + lpUnicodeBuffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nNumberOfBytesToRead); + if (lpUnicodeBuffer == NULL) + { + DPRINT1("Alloc failed!\n"); + return FALSE; + } + + if (!ReadFile(hFile, lpUnicodeBuffer, nNumberOfBytesToRead, &dwRead, NULL)) + { + DPRINT1("Read failed!\n"); + ret = FALSE; + goto done; + } + + Dst = (PEVENTLOGRECORD)lpBuffer; + Src = (PEVENTLOGRECORD)lpUnicodeBuffer; + + Dst->TimeGenerated = Src->TimeGenerated; + Dst->Reserved = Src->Reserved; + Dst->RecordNumber = Src->RecordNumber; + Dst->TimeWritten = Src->TimeWritten; + Dst->EventID = Src->EventID; + Dst->EventType = Src->EventType; + Dst->EventCategory = Src->EventCategory; + Dst->NumStrings = Src->NumStrings; + Dst->UserSidLength = Src->UserSidLength; + Dst->DataLength = Src->DataLength; + + SrcPtr = (LPWSTR)((DWORD_PTR)Src + sizeof(EVENTLOGRECORD)); + DstPtr = (LPSTR)((DWORD_PTR)Dst + sizeof(EVENTLOGRECORD)); + + /* Convert the module name */ + RtlInitUnicodeString(&StringW, SrcPtr); + Status = RtlUnicodeStringToAnsiString(&StringA, &StringW, TRUE); + if (NT_SUCCESS(Status)) + { + RtlCopyMemory(DstPtr, StringA.Buffer, StringA.MaximumLength); + + DstPtr = (PVOID)((DWORD_PTR)DstPtr + StringA.MaximumLength); + + RtlFreeAnsiString(&StringA); + } + + /* Convert the computer name */ + if (NT_SUCCESS(Status)) + { + SrcPtr = (PWSTR)((DWORD_PTR)SrcPtr + StringW.MaximumLength); + + RtlInitUnicodeString(&StringW, SrcPtr); + Status = RtlUnicodeStringToAnsiString(&StringA, &StringW, TRUE); + if (NT_SUCCESS(Status)) + { + RtlCopyMemory(DstPtr, StringA.Buffer, StringA.MaximumLength); + + DstPtr = (PVOID)((DWORD_PTR)DstPtr + StringA.MaximumLength); + + RtlFreeAnsiString(&StringA); + } + } + + /* Add the padding and the User SID*/ + if (NT_SUCCESS(Status)) + { + dwPadding = sizeof(DWORD) - (((DWORD_PTR)DstPtr - (DWORD_PTR)Dst) % sizeof(DWORD)); + RtlZeroMemory(DstPtr, dwPadding); + + DstPtr = (LPSTR)((DWORD_PTR)DstPtr + dwPadding); + RtlCopyMemory(DstPtr, + (PVOID)((DWORD_PTR)Src + Src->UserSidOffset), + Src->UserSidLength); + + Dst->UserSidOffset = (DWORD)((DWORD_PTR)DstPtr - (DWORD_PTR)Dst); + } + + + /* Convert the strings */ + if (NT_SUCCESS(Status)) + { + DstPtr = (PVOID)((DWORD_PTR)DstPtr + Src->UserSidLength); + + SrcString = (LPWSTR)((DWORD_PTR)Src + (DWORD)Src->StringOffset); + DstString = (LPSTR)DstPtr; + + for (i = 0; i < Dst->NumStrings; i++) + { + RtlInitUnicodeString(&StringW, SrcString); + + RtlUnicodeStringToAnsiString(&StringA, &StringW, TRUE); + + RtlCopyMemory(DstString, StringA.Buffer, StringA.MaximumLength); + + SrcString = (LPWSTR)((DWORD_PTR)SrcString + + (DWORD)StringW.MaximumLength); + + DstString = (LPSTR)((DWORD_PTR)DstString + + (DWORD)StringA.MaximumLength); + + RtlFreeAnsiString(&StringA); + } + + Dst->StringOffset = (DWORD)((DWORD_PTR)DstPtr - (DWORD_PTR)Dst); + + + /* Copy the binary data */ + DstPtr = (PVOID)DstString; + Dst->DataOffset = (DWORD_PTR)DstPtr - (DWORD_PTR)Dst; + + RtlCopyMemory(DstPtr, (PVOID)((DWORD_PTR)Src + Src->DataOffset), Src->DataLength); + + /* Add the padding */ + DstPtr = (PVOID)((DWORD_PTR)DstPtr + Src->DataLength); + dwPadding = sizeof(DWORD) - (((DWORD_PTR)DstPtr-(DWORD_PTR)Dst) % sizeof(DWORD)); + RtlZeroMemory(DstPtr, dwPadding); + + dwEntryLength = (DWORD)((DWORD_PTR)DstPtr + dwPadding + sizeof(DWORD) - (DWORD_PTR)Dst); + + /* Set the entry length at the end of the entry*/ + pLength = (PDWORD)((DWORD_PTR)DstPtr + dwPadding); + *pLength = dwEntryLength; + Dst->Length = dwEntryLength; + + *lpNumberOfBytesRead = dwEntryLength; + } + +done: + if (lpUnicodeBuffer != NULL) + HeapFree(GetProcessHeap(), 0, lpUnicodeBuffer); + + return ret; +} + DWORD LogfReadEvent(PLOGFILE LogFile, DWORD Flags, @@ -549,7 +706,8 @@ DWORD BufSize, PBYTE Buffer, DWORD * BytesRead, - DWORD * BytesNeeded) + DWORD * BytesNeeded, + BOOL Ansi) { DWORD dwOffset, dwRead, dwRecSize; DWORD dwBufferUsage = 0, dwRecNum; @@ -611,10 +769,21 @@ goto Done; } - if (!ReadFile(LogFile->hFile, Buffer, dwRecSize, &dwRead, NULL)) - { - DPRINT1("ReadFile() failed!\n"); - goto Done; + if (Ansi == TRUE) + { + if (!ReadAnsiLogEntry(LogFile->hFile, Buffer, dwRecSize, &dwRead)) + { + DPRINT1("ReadAnsiLogEntry() failed!\n"); + goto Done; + } + } + else + { + if (!ReadFile(LogFile->hFile, Buffer, dwRecSize, &dwRead, NULL)) + { + DPRINT1("ReadFile() failed!\n"); + goto Done; + } } dwBufferUsage += dwRead; @@ -659,14 +828,28 @@ goto Done; } - if (!ReadFile(LogFile->hFile, - Buffer + dwBufferUsage, - dwRecSize, - &dwRead, - NULL)) - { - DPRINT1("ReadFile() failed!\n"); - goto Done; + if (Ansi == TRUE) + { + if (!ReadAnsiLogEntry(LogFile->hFile, + Buffer + dwBufferUsage, + dwRecSize, + &dwRead)) + { + DPRINT1("ReadAnsiLogEntry() failed!\n"); + goto Done; + } + } + else + { + if (!ReadFile(LogFile->hFile, + Buffer + dwBufferUsage, + dwRecSize, + &dwRead, + NULL)) + { + DPRINT1("ReadFile() failed!\n"); + goto Done; + } } dwBufferUsage += dwRead; @@ -870,9 +1053,8 @@ return TRUE; } +/* Returns 0 if nothing found. */ ULONG LogfOffsetByNumber(PLOGFILE LogFile, DWORD RecordNumber) - -/* Returns 0 if nothing found. */ { DWORD i; @@ -1012,10 +1194,12 @@ pos += (lstrlenW(ComputerName) + 1) * sizeof(WCHAR); pRec->UserSidOffset = pos; + + if (pos % 4 != 0) + pos += 4 - (pos % 4); + if (dwSidLength) { - if (pos % 4 != 0) - pos += 4 - (pos % 4); CopyMemory(Buffer + pos, lpUserSid, dwSidLength); pRec->UserSidLength = dwSidLength; pRec->UserSidOffset = pos; Modified: trunk/reactos/base/services/eventlog/rpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/rpc…
============================================================================== --- trunk/reactos/base/services/eventlog/rpc.c [iso-8859-1] (original) +++ trunk/reactos/base/services/eventlog/rpc.c [iso-8859-1] Sat Dec 17 13:22:10 2011 @@ -225,6 +225,8 @@ PLOGHANDLE lpLogHandle; PLOGFILE lpLogFile; + DPRINT("ElfrNumberOfRecords()"); + lpLogHandle = ElfGetLogHandleEntryByHandle(LogHandle); if (!lpLogHandle) { @@ -232,6 +234,10 @@ } lpLogFile = lpLogHandle->LogFile; + + DPRINT("Oldest: %lu Current: %lu\n", + lpLogFile->Header.OldestRecordNumber, + lpLogFile->Header.CurrentRecordNumber); if (lpLogFile->Header.OldestRecordNumber == 0) *NumberOfRecords = 0; @@ -372,8 +378,8 @@ return STATUS_INVALID_HANDLE; } - if (!Buffer) - return I_RpcMapWin32Status(ERROR_INVALID_PARAMETER); + if (!Buffer) + return STATUS_INVALID_PARAMETER; /* If sequential read, retrieve the CurrentRecord from this log handle */ if (ReadFlags & EVENTLOG_SEQUENTIAL_READ) @@ -386,13 +392,18 @@ } dwError = LogfReadEvent(lpLogHandle->LogFile, ReadFlags, &RecordNumber, - NumberOfBytesToRead, Buffer, NumberOfBytesRead, MinNumberOfBytesNeeded); + NumberOfBytesToRead, Buffer, NumberOfBytesRead, MinNumberOfBytesNeeded, + FALSE); /* Update the handles CurrentRecord if success*/ if (dwError == ERROR_SUCCESS) { lpLogHandle->CurrentRecord = RecordNumber; } + + /* HACK!!! */ + if (dwError == ERROR_HANDLE_EOF) + return STATUS_END_OF_FILE; return I_RpcMapWin32Status(dwError); } @@ -664,8 +675,49 @@ DWORD *NumberOfBytesRead, DWORD *MinNumberOfBytesNeeded) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + PLOGHANDLE lpLogHandle; + DWORD dwError; + DWORD RecordNumber; + + lpLogHandle = ElfGetLogHandleEntryByHandle(LogHandle); + if (!lpLogHandle) + { + return STATUS_INVALID_HANDLE; + } + + if (!Buffer) + return STATUS_INVALID_PARAMETER; + + /* If sequential read, retrieve the CurrentRecord from this log handle */ + if (ReadFlags & EVENTLOG_SEQUENTIAL_READ) + { + RecordNumber = lpLogHandle->CurrentRecord; + } + else + { + RecordNumber = RecordOffset; + } + + dwError = LogfReadEvent(lpLogHandle->LogFile, + ReadFlags, + &RecordNumber, + NumberOfBytesToRead, + Buffer, + NumberOfBytesRead, + MinNumberOfBytesNeeded, + TRUE); + + /* Update the handles CurrentRecord if success*/ + if (dwError == ERROR_SUCCESS) + { + lpLogHandle->CurrentRecord = RecordNumber; + } + + /* HACK!!! */ + if (dwError == ERROR_HANDLE_EOF) + return STATUS_END_OF_FILE; + + return I_RpcMapWin32Status(dwError); }
13 years
1
0
0
0
[cgutman] 54671: [NTOSKRNL] - Fix bad indentation
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Dec 17 12:59:01 2011 New Revision: 54671 URL:
http://svn.reactos.org/svn/reactos?rev=54671&view=rev
Log: [NTOSKRNL] - Fix bad indentation Modified: trunk/reactos/ntoskrnl/cc/view.c Modified: trunk/reactos/ntoskrnl/cc/view.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/view.c?rev=546…
============================================================================== --- trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] Sat Dec 17 12:59:01 2011 @@ -993,76 +993,76 @@ */ VOID NTAPI CcFlushCache(IN PSECTION_OBJECT_POINTERS SectionObjectPointers, - IN PLARGE_INTEGER FileOffset OPTIONAL, - IN ULONG Length, - OUT PIO_STATUS_BLOCK IoStatus) -{ - PBCB Bcb; - LARGE_INTEGER Offset; - PCACHE_SEGMENT current; - NTSTATUS Status; - KIRQL oldIrql; - - DPRINT("CcFlushCache(SectionObjectPointers 0x%p, FileOffset 0x%p, Length %d, IoStatus 0x%p)\n", + IN PLARGE_INTEGER FileOffset OPTIONAL, + IN ULONG Length, + OUT PIO_STATUS_BLOCK IoStatus) +{ + PBCB Bcb; + LARGE_INTEGER Offset; + PCACHE_SEGMENT current; + NTSTATUS Status; + KIRQL oldIrql; + + DPRINT("CcFlushCache(SectionObjectPointers 0x%p, FileOffset 0x%p, Length %d, IoStatus 0x%p)\n", SectionObjectPointers, FileOffset, Length, IoStatus); - if (SectionObjectPointers && SectionObjectPointers->SharedCacheMap) - { - Bcb = (PBCB)SectionObjectPointers->SharedCacheMap; - ASSERT(Bcb); - if (FileOffset) - { - Offset = *FileOffset; - } - else - { - Offset.QuadPart = (LONGLONG)0; - Length = Bcb->FileSize.u.LowPart; - } - - if (IoStatus) - { - IoStatus->Status = STATUS_SUCCESS; - IoStatus->Information = 0; - } - - while (Length > 0) - { - current = CcRosLookupCacheSegment (Bcb, Offset.u.LowPart); - if (current != NULL) - { - if (current->Dirty) - { - Status = CcRosFlushCacheSegment(current); - if (!NT_SUCCESS(Status) && IoStatus != NULL) - { - IoStatus->Status = Status; - } - } - KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); - ExReleasePushLock(¤t->Lock); - CcRosCacheSegmentDecRefCount(current); - KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); - } - - Offset.QuadPart += Bcb->CacheSegmentSize; - if (Length > Bcb->CacheSegmentSize) - { - Length -= Bcb->CacheSegmentSize; - } - else - { - Length = 0; - } - } - } - else - { - if (IoStatus) - { - IoStatus->Status = STATUS_INVALID_PARAMETER; - } - } + if (SectionObjectPointers && SectionObjectPointers->SharedCacheMap) + { + Bcb = (PBCB)SectionObjectPointers->SharedCacheMap; + ASSERT(Bcb); + if (FileOffset) + { + Offset = *FileOffset; + } + else + { + Offset.QuadPart = (LONGLONG)0; + Length = Bcb->FileSize.u.LowPart; + } + + if (IoStatus) + { + IoStatus->Status = STATUS_SUCCESS; + IoStatus->Information = 0; + } + + while (Length > 0) + { + current = CcRosLookupCacheSegment (Bcb, Offset.u.LowPart); + if (current != NULL) + { + if (current->Dirty) + { + Status = CcRosFlushCacheSegment(current); + if (!NT_SUCCESS(Status) && IoStatus != NULL) + { + IoStatus->Status = Status; + } + } + KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); + ExReleasePushLock(¤t->Lock); + CcRosCacheSegmentDecRefCount(current); + KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); + } + + Offset.QuadPart += Bcb->CacheSegmentSize; + if (Length > Bcb->CacheSegmentSize) + { + Length -= Bcb->CacheSegmentSize; + } + else + { + Length = 0; + } + } + } + else + { + if (IoStatus) + { + IoStatus->Status = STATUS_INVALID_PARAMETER; + } + } } NTSTATUS @@ -1072,68 +1072,68 @@ * FUNCTION: Releases the BCB associated with a file object */ { - PLIST_ENTRY current_entry; - PCACHE_SEGMENT current; - LIST_ENTRY FreeList; - KIRQL oldIrql; - - ASSERT(Bcb); - - Bcb->RefCount++; - KeReleaseGuardedMutex(&ViewLock); - - CcFlushCache(FileObject->SectionObjectPointer, NULL, 0, NULL); - - KeAcquireGuardedMutex(&ViewLock); - Bcb->RefCount--; - if (Bcb->RefCount == 0) - { - if (Bcb->BcbRemoveListEntry.Flink != NULL) - { - RemoveEntryList(&Bcb->BcbRemoveListEntry); - Bcb->BcbRemoveListEntry.Flink = NULL; - } - - FileObject->SectionObjectPointer->SharedCacheMap = NULL; - - /* - * Release all cache segments. - */ - InitializeListHead(&FreeList); - KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); - current_entry = Bcb->BcbSegmentListHead.Flink; - while (!IsListEmpty(&Bcb->BcbSegmentListHead)) - { - current_entry = RemoveTailList(&Bcb->BcbSegmentListHead); - current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); - RemoveEntryList(¤t->CacheSegmentListEntry); - RemoveEntryList(¤t->CacheSegmentLRUListEntry); - if (current->Dirty) - { - RemoveEntryList(¤t->DirtySegmentListEntry); - DirtyPageCount -= Bcb->CacheSegmentSize / PAGE_SIZE; - DPRINT1("Freeing dirty segment\n"); - } - InsertHeadList(&FreeList, ¤t->BcbSegmentListEntry); - } + PLIST_ENTRY current_entry; + PCACHE_SEGMENT current; + LIST_ENTRY FreeList; + KIRQL oldIrql; + + ASSERT(Bcb); + + Bcb->RefCount++; + KeReleaseGuardedMutex(&ViewLock); + + CcFlushCache(FileObject->SectionObjectPointer, NULL, 0, NULL); + + KeAcquireGuardedMutex(&ViewLock); + Bcb->RefCount--; + if (Bcb->RefCount == 0) + { + if (Bcb->BcbRemoveListEntry.Flink != NULL) + { + RemoveEntryList(&Bcb->BcbRemoveListEntry); + Bcb->BcbRemoveListEntry.Flink = NULL; + } + + FileObject->SectionObjectPointer->SharedCacheMap = NULL; + + /* + * Release all cache segments. + */ + InitializeListHead(&FreeList); + KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); + current_entry = Bcb->BcbSegmentListHead.Flink; + while (!IsListEmpty(&Bcb->BcbSegmentListHead)) + { + current_entry = RemoveTailList(&Bcb->BcbSegmentListHead); + current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); + RemoveEntryList(¤t->CacheSegmentListEntry); + RemoveEntryList(¤t->CacheSegmentLRUListEntry); + if (current->Dirty) + { + RemoveEntryList(¤t->DirtySegmentListEntry); + DirtyPageCount -= Bcb->CacheSegmentSize / PAGE_SIZE; + DPRINT1("Freeing dirty segment\n"); + } + InsertHeadList(&FreeList, ¤t->BcbSegmentListEntry); + } #if DBG - Bcb->Trace = FALSE; -#endif - KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); - - KeReleaseGuardedMutex(&ViewLock); - ObDereferenceObject (Bcb->FileObject); - - while (!IsListEmpty(&FreeList)) - { - current_entry = RemoveTailList(&FreeList); - current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); - CcRosInternalFreeCacheSegment(current); - } - ExFreeToNPagedLookasideList(&BcbLookasideList, Bcb); - KeAcquireGuardedMutex(&ViewLock); - } - return(STATUS_SUCCESS); + Bcb->Trace = FALSE; +#endif + KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); + + KeReleaseGuardedMutex(&ViewLock); + ObDereferenceObject (Bcb->FileObject); + + while (!IsListEmpty(&FreeList)) + { + current_entry = RemoveTailList(&FreeList); + current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); + CcRosInternalFreeCacheSegment(current); + } + ExFreeToNPagedLookasideList(&BcbLookasideList, Bcb); + KeAcquireGuardedMutex(&ViewLock); + } + return(STATUS_SUCCESS); } VOID
13 years
1
0
0
0
[cgutman] 54670: [VIDEOPRT] - "RegionSize must be zero" doesn't mean literally pass 0 for the region size...
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Dec 17 09:18:24 2011 New Revision: 54670 URL:
http://svn.reactos.org/svn/reactos?rev=54670&view=rev
Log: [VIDEOPRT] - "RegionSize must be zero" doesn't mean literally pass 0 for the region size... Modified: trunk/reactos/drivers/video/videoprt/int10.c Modified: trunk/reactos/drivers/video/videoprt/int10.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/videoprt/int…
============================================================================== --- trunk/reactos/drivers/video/videoprt/int10.c [iso-8859-1] (original) +++ trunk/reactos/drivers/video/videoprt/int10.c [iso-8859-1] Sat Dec 17 09:18:24 2011 @@ -82,13 +82,14 @@ NTSTATUS Status; PKPROCESS CallingProcess = (PKPROCESS)PsGetCurrentProcess(); KAPC_STATE ApcState; + SIZE_T Size = 0; TRACE_(VIDEOPRT, "IntInt10FreeBuffer\n"); INFO_(VIDEOPRT, "- Segment: %x\n", Seg); INFO_(VIDEOPRT, "- Offset: %x\n", Off); IntAttachToCSRSS(&CallingProcess, &ApcState); - Status = ZwFreeVirtualMemory(NtCurrentProcess(), &MemoryAddress, 0, + Status = ZwFreeVirtualMemory(NtCurrentProcess(), &MemoryAddress, &Size, MEM_RELEASE); IntDetachFromCSRSS(&CallingProcess, &ApcState);
13 years
1
0
0
0
[cgutman] 54669: [WIN32K] EngAllocMem: - Respect the FL_NONPAGED_MEMORY flag (actually allocate the memory from non-paged pool) - Fix an improper flag comparison that caused memory allocated with b...
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Dec 17 08:35:31 2011 New Revision: 54669 URL:
http://svn.reactos.org/svn/reactos?rev=54669&view=rev
Log: [WIN32K] EngAllocMem: - Respect the FL_NONPAGED_MEMORY flag (actually allocate the memory from non-paged pool) - Fix an improper flag comparison that caused memory allocated with both FL_NONPAGED_MEMORY and FL_ZERO_MEMORY set to not be zeroed as requested Modified: trunk/reactos/subsystems/win32/win32k/eng/mem.c Modified: trunk/reactos/subsystems/win32/win32k/eng/mem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/mem.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/mem.c [iso-8859-1] Sat Dec 17 08:35:31 2011 @@ -19,16 +19,19 @@ ULONG MemSize, ULONG Tag) { - PVOID newMem; + PVOID newMem; - newMem = ExAllocatePoolWithTag(PagedPool, MemSize, Tag); + newMem = ExAllocatePoolWithTag((Flags & FL_NONPAGED_MEMORY) ? NonPagedPool : PagedPool, + MemSize, + Tag); - if (Flags == FL_ZERO_MEMORY && NULL != newMem) - { - RtlZeroMemory(newMem, MemSize); - } + if (newMem == NULL) + return NULL; - return newMem; + if (Flags & FL_ZERO_MEMORY) + RtlZeroMemory(newMem, MemSize); + + return newMem; } /*
13 years
1
0
0
0
[cgutman] 54668: [RTL] - Pass size 0 when calling NtFreeVirtualMemory for MEM_RELEASE
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Dec 17 08:30:48 2011 New Revision: 54668 URL:
http://svn.reactos.org/svn/reactos?rev=54668&view=rev
Log: [RTL] - Pass size 0 when calling NtFreeVirtualMemory for MEM_RELEASE Modified: trunk/reactos/lib/rtl/handle.c Modified: trunk/reactos/lib/rtl/handle.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/handle.c?rev=54668…
============================================================================== --- trunk/reactos/lib/rtl/handle.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/handle.c [iso-8859-1] Sat Dec 17 08:30:48 2011 @@ -35,13 +35,12 @@ RtlDestroyHandleTable(PRTL_HANDLE_TABLE HandleTable) { PVOID ArrayPointer; - SIZE_T ArraySize; + SIZE_T ArraySize = 0; /* free handle array */ if (HandleTable->CommittedHandles) { ArrayPointer = (PVOID)HandleTable->CommittedHandles; - ArraySize = HandleTable->SizeOfHandleTableEntry * HandleTable->MaximumNumberOfHandles; NtFreeVirtualMemory(NtCurrentProcess(), &ArrayPointer, &ArraySize,
13 years
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
25
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
Results per page:
10
25
50
100
200