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
September 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
20 participants
399 discussions
Start a n
N
ew thread
[gadamopoulos] 53640: [user32_apitest] - Add more tests for SetActiveWindow
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Thu Sep 8 11:31:31 2011 New Revision: 53640 URL:
http://svn.reactos.org/svn/reactos?rev=53640&view=rev
Log: [user32_apitest] - Add more tests for SetActiveWindow Modified: trunk/rostests/apitests/user32/SetActiveWindow.c Modified: trunk/rostests/apitests/user32/SetActiveWindow.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/SetActive…
============================================================================== --- trunk/rostests/apitests/user32/SetActiveWindow.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/SetActiveWindow.c [iso-8859-1] Thu Sep 8 11:31:31 2011 @@ -84,6 +84,14 @@ EXPECT_NEXT(hWnd4,hWnd1); EXPECT_NEXT(hWnd1,hWnd3); EXPECT_ACTIVE(hWnd2); + + SetActiveWindow(hWnd1); + while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); + + EXPECT_NEXT(hWnd2,hWnd4); + EXPECT_NEXT(hWnd4,hWnd1); + EXPECT_NEXT(hWnd1,hWnd3); + EXPECT_ACTIVE(hWnd1); } START_TEST(SetActiveWindow)
13 years, 3 months
1
0
0
0
[tfaber] 53639: [KMTEST_OLD] - Remove kmtest_old and kmtloader as all their functionality is included in the new test suite
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Sep 8 10:44:26 2011 New Revision: 53639 URL:
http://svn.reactos.org/svn/reactos?rev=53639&view=rev
Log: [KMTEST_OLD] - Remove kmtest_old and kmtloader as all their functionality is included in the new test suite Removed: branches/GSoC_2011/KMTestSuite/drivers/CMakeLists.txt branches/GSoC_2011/KMTestSuite/drivers/kmtest/ branches/GSoC_2011/KMTestSuite/win32/CMakeLists.txt branches/GSoC_2011/KMTestSuite/win32/kmtloader/ Modified: branches/GSoC_2011/KMTestSuite/CMakeLists.txt branches/GSoC_2011/KMTestSuite/drivers/directory.rbuild branches/GSoC_2011/KMTestSuite/win32/testsets.rbuild Modified: branches/GSoC_2011/KMTestSuite/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/CMakeList…
============================================================================== --- branches/GSoC_2011/KMTestSuite/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:44:26 2011 @@ -1,7 +1,7 @@ add_subdirectory(apitests) #add_subdirectory(dibtests) -add_subdirectory(drivers) +#add_subdirectory(drivers) #add_subdirectory(dxtest) add_subdirectory(kmtests) #add_subdirectory(regtests) @@ -9,5 +9,5 @@ add_subdirectory(rosautotest) endif() add_subdirectory(tests) -add_subdirectory(win32) +#add_subdirectory(win32) add_subdirectory(winetests) Removed: branches/GSoC_2011/KMTestSuite/drivers/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/drivers/C…
============================================================================== --- branches/GSoC_2011/KMTestSuite/drivers/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/drivers/CMakeLists.txt (removed) @@ -1,5 +1,0 @@ - -#add_subdirectory(csqtest) -add_subdirectory(kmtest) -#add_subdirectory(memtest) -#add_subdirectory(ntoskrnl) Modified: branches/GSoC_2011/KMTestSuite/drivers/directory.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/drivers/d…
============================================================================== --- branches/GSoC_2011/KMTestSuite/drivers/directory.rbuild [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/drivers/directory.rbuild [iso-8859-1] Thu Sep 8 10:44:26 2011 @@ -4,12 +4,6 @@ <directory name="csqtest"> <xi:include href="csqtest/csqtest.rbuild" /> </directory> - <directory name="kmtest"> - <xi:include href="kmtest/kmtest.rbuild" /> - </directory> - <directory name="kmtest"> - <xi:include href="kmtest/kmtestassist.rbuild" /> - </directory> <directory name="memtest"> <xi:include href="memtest/memtest.rbuild" /> </directory> Removed: branches/GSoC_2011/KMTestSuite/win32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/win32/CMa…
============================================================================== --- branches/GSoC_2011/KMTestSuite/win32/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/win32/CMakeLists.txt (removed) @@ -1,11 +1,0 @@ - -#add_subdirectory(cmd) -#add_subdirectory(DriverLoading) -#add_subdirectory(kernel32) -add_subdirectory(kmtloader) -#add_subdirectory(loadlib) -#add_subdirectory(msvcrt) -#add_subdirectory(rpcrt4) -#add_subdirectory(smss) -#add_subdirectory(user32) -#add_subdirectory(win32k) Modified: branches/GSoC_2011/KMTestSuite/win32/testsets.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/win32/tes…
============================================================================== --- branches/GSoC_2011/KMTestSuite/win32/testsets.rbuild [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/win32/testsets.rbuild [iso-8859-1] Thu Sep 8 10:44:26 2011 @@ -3,9 +3,6 @@ <group xmlns:xi="
http://www.w3.org/2001/XInclude
"> <directory name="kernel32"> <xi:include href="kernel32/directory.rbuild" /> - </directory> - <directory name="kmtloader"> - <xi:include href="kmtloader/kmtloader.rbuild" /> </directory> <directory name="smss"> <xi:include href="smss/smss.rbuild" />
13 years, 3 months
1
0
0
0
[tfaber] 53638: [KMTestSuite] - Sync to rostests r53632
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Sep 8 10:28:02 2011 New Revision: 53638 URL:
http://svn.reactos.org/svn/reactos?rev=53638&view=rev
Log: [KMTestSuite] - Sync to rostests r53632 Added: branches/GSoC_2011/KMTestSuite/apitests/user32/SetActiveWindow.c - copied unchanged from r53637, trunk/rostests/apitests/user32/SetActiveWindow.c Modified: branches/GSoC_2011/KMTestSuite/ (props changed) branches/GSoC_2011/KMTestSuite/apitests/user32/CMakeLists.txt branches/GSoC_2011/KMTestSuite/apitests/user32/testlist.c branches/GSoC_2011/KMTestSuite/apitests/user32/user32_apitest.rbuild branches/GSoC_2011/KMTestSuite/tests/pseh2/CMakeLists.txt branches/GSoC_2011/KMTestSuite/winetests/comctl32/CMakeLists.txt branches/GSoC_2011/KMTestSuite/winetests/fusion/CMakeLists.txt branches/GSoC_2011/KMTestSuite/winetests/gdi32/CMakeLists.txt branches/GSoC_2011/KMTestSuite/winetests/gdi32/metafile.c branches/GSoC_2011/KMTestSuite/winetests/kernel32/CMakeLists.txt branches/GSoC_2011/KMTestSuite/winetests/msvcrt/CMakeLists.txt branches/GSoC_2011/KMTestSuite/winetests/ntdll/CMakeLists.txt branches/GSoC_2011/KMTestSuite/winetests/powrprof/CMakeLists.txt branches/GSoC_2011/KMTestSuite/winetests/rpcrt4/CMakeLists.txt branches/GSoC_2011/KMTestSuite/winetests/setupapi/CMakeLists.txt branches/GSoC_2011/KMTestSuite/winetests/shdocvw/CMakeLists.txt branches/GSoC_2011/KMTestSuite/winetests/urlmon/CMakeLists.txt branches/GSoC_2011/KMTestSuite/winetests/user32/CMakeLists.txt branches/GSoC_2011/KMTestSuite/winetests/wininet/CMakeLists.txt branches/GSoC_2011/KMTestSuite/winetests/winmm/CMakeLists.txt branches/GSoC_2011/KMTestSuite/winetests/ws2_32/CMakeLists.txt Propchange: branches/GSoC_2011/KMTestSuite/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Sep 8 10:28:02 2011 @@ -1,1 +1,1 @@ -/trunk/rostests:51165-53563 +/trunk/rostests:51165-53637 Modified: branches/GSoC_2011/KMTestSuite/apitests/user32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/apitests/…
============================================================================== --- branches/GSoC_2011/KMTestSuite/apitests/user32/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/apitests/user32/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -14,6 +14,7 @@ ScrollDC.c ScrollWindowEx.c SetCursorPos.c + SetActiveWindow.c WndProc.c testlist.c user32_apitest.rc) Modified: branches/GSoC_2011/KMTestSuite/apitests/user32/testlist.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/apitests/…
============================================================================== --- branches/GSoC_2011/KMTestSuite/apitests/user32/testlist.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/apitests/user32/testlist.c [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -15,6 +15,7 @@ extern void func_DeferWindowPos(void); extern void func_GetKeyState(void); extern void func_SetCursorPos(void); +extern void func_SetActiveWindow(void); extern void func_WndProc(void); const struct test winetest_testlist[] = @@ -29,6 +30,7 @@ { "DeferWindowPos", func_DeferWindowPos }, { "GetKeyState", func_GetKeyState }, { "SetCursorPos", func_SetCursorPos }, + { "SetActiveWindow", func_SetActiveWindow }, { "WndProc", func_WndProc }, { 0, 0 } }; Modified: branches/GSoC_2011/KMTestSuite/apitests/user32/user32_apitest.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/apitests/…
============================================================================== --- branches/GSoC_2011/KMTestSuite/apitests/user32/user32_apitest.rbuild [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/apitests/user32/user32_apitest.rbuild [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -19,6 +19,7 @@ <file>GetIconInfo.c</file> <file>GetPeekMessage.c</file> <file>DeferWindowPos.c</file> + <file>SetActiveWindow.c</file> <file>SetCursorPos.c</file> <file>WndProc.c</file> Modified: branches/GSoC_2011/KMTestSuite/tests/pseh2/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/tests/pse…
============================================================================== --- branches/GSoC_2011/KMTestSuite/tests/pseh2/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/tests/pseh2/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -6,3 +6,7 @@ set_module_type(pseh2_test win32cui) add_importlibs(pseh2_test msvcrt kernel32 ntdll) add_cd_file(TARGET pseh2_test DESTINATION reactos/bin FOR all) + +if(NOT MSVC) + allow_warnings(pseh2_test) +endif() Modified: branches/GSoC_2011/KMTestSuite/winetests/comctl32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/comctl32/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/comctl32/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -39,6 +39,8 @@ if(MSVC) target_link_libraries(comctl32_winetest uuid) +else() + allow_warnings(comctl32_winetest) endif() set_module_type(comctl32_winetest win32cui) Modified: branches/GSoC_2011/KMTestSuite/winetests/fusion/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/fusion/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/fusion/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -15,3 +15,7 @@ set_module_type(fusion_winetest win32cui) add_importlibs(fusion_winetest user32 msvcrt kernel32 ntdll) add_cd_file(TARGET fusion_winetest DESTINATION reactos/bin FOR all) + +if(NOT MSVC) + allow_warnings(fusion_winetest) +endif() Modified: branches/GSoC_2011/KMTestSuite/winetests/gdi32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/gdi32/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/gdi32/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -2,6 +2,8 @@ add_definitions( -D__ROS_LONG64__ -D_DLL -D__USE_CRTIMP) + +remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502) list(APPEND SOURCE bitmap.c Modified: branches/GSoC_2011/KMTestSuite/winetests/gdi32/metafile.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/gdi32/metafile.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/gdi32/metafile.c [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -1427,14 +1427,15 @@ const ENHMETARECORD *emr1 = (const ENHMETARECORD *)(bits + offset1); const ENHMETARECORD *emr2 = (const ENHMETARECORD *)(buf + offset2); -#if 1 +if(!winetest_interactive) skip("skipping match_emf_record(), bug 5393\n"); -#else +else +{ trace("%s: EMF record %u, size %u/record %u, size %u\n", desc, emr1->iType, emr1->nSize, emr2->iType, emr2->nSize); if (!match_emf_record(emr1, emr2, desc, ignore_scaling)) return -1; -#endif +} /* We have already bailed out if iType or nSize don't match */ offset1 += emr1->nSize; Modified: branches/GSoC_2011/KMTestSuite/winetests/kernel32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/kernel32/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/kernel32/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -2,6 +2,8 @@ add_definitions( -D__ROS_LONG64__ -D_DLL -D__USE_CRTIMP) + +remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502) set_rc_compiler() @@ -48,5 +50,8 @@ target_link_libraries(kernel32_winetest wine) set_module_type(kernel32_winetest win32cui) add_importlibs(kernel32_winetest user32 advapi32 msvcrt kernel32 ntdll) +if(NOT MSVC) + allow_warnings(kernel32_winetest) +endif() add_cd_file(TARGET kernel32_winetest DESTINATION reactos/bin FOR all) Modified: branches/GSoC_2011/KMTestSuite/winetests/msvcrt/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/msvcrt/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/msvcrt/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -24,6 +24,8 @@ if(MSVC) target_link_libraries(msvcrt_winetest oldnames) +else() + allow_warnings(msvcrt_winetest) endif() set_module_type(msvcrt_winetest win32cui) Modified: branches/GSoC_2011/KMTestSuite/winetests/ntdll/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/ntdll/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/ntdll/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -29,3 +29,6 @@ set_module_type(ntdll_winetest win32cui) add_importlibs(ntdll_winetest user32 msvcrt kernel32 ntdll) add_cd_file(TARGET ntdll_winetest DESTINATION reactos/bin FOR all) +if(NOT MSVC) + allow_warnings(ntdll_winetest) +endif() Modified: branches/GSoC_2011/KMTestSuite/winetests/powrprof/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/powrprof/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/powrprof/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -8,3 +8,7 @@ set_module_type(powrprof_winetest win32cui) add_importlibs(powrprof_winetest advapi32 powrprof msvcrt kernel32 ntdll) add_cd_file(TARGET powrprof_winetest DESTINATION reactos/bin FOR all) + +if(NOT MSVC) + allow_warnings(powrprof_winetest) +endif() Modified: branches/GSoC_2011/KMTestSuite/winetests/rpcrt4/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/rpcrt4/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/rpcrt4/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -1,5 +1,6 @@ -remove_definitions(-D_WIN32_WINNT=0x502) +remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502) + add_definitions(-D_WIN32_WINNT=0x500) add_definitions( @@ -44,3 +45,7 @@ set_module_type(rpcrt4_winetest win32cui) add_importlibs(rpcrt4_winetest ole32 rpcrt4 msvcrt kernel32 ntdll) add_cd_file(TARGET rpcrt4_winetest DESTINATION reactos/bin FOR all) + +if(NOT MSVC) + allow_warnings(rpcrt4_winetest) +endif() Modified: branches/GSoC_2011/KMTestSuite/winetests/setupapi/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/setupapi/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/setupapi/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -19,3 +19,7 @@ set_module_type(setupapi_winetest win32cui) add_importlibs(setupapi_winetest advapi32 setupapi user32 msvcrt kernel32 ntdll) add_cd_file(TARGET setupapi_winetest DESTINATION reactos/bin FOR all) + +if(NOT MSVC) + allow_warnings(setupapi_winetest) +endif() Modified: branches/GSoC_2011/KMTestSuite/winetests/shdocvw/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/shdocvw/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/shdocvw/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -15,3 +15,7 @@ set_module_type(shdocvw_winetest win32cui) add_importlibs(shdocvw_winetest gdi32 shell32 ole32 oleaut32 user32 advapi32 msvcrt kernel32 ntdll) add_cd_file(TARGET shdocvw_winetest DESTINATION reactos/bin FOR all) + +if(NOT MSVC) + allow_warnings(shdocvw_winetest) +endif() Modified: branches/GSoC_2011/KMTestSuite/winetests/urlmon/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/urlmon/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/urlmon/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -1,3 +1,5 @@ + +remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502) add_definitions( -D__ROS_LONG64__ Modified: branches/GSoC_2011/KMTestSuite/winetests/user32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/user32/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/user32/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -38,3 +38,7 @@ set_module_type(user32_winetest win32cui) add_importlibs(user32_winetest user32 gdi32 advapi32 msvcrt kernel32 ntdll) add_cd_file(TARGET user32_winetest DESTINATION reactos/bin FOR all) + +if(NOT MSVC) + allow_warnings(user32_winetest) +endif() Modified: branches/GSoC_2011/KMTestSuite/winetests/wininet/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/wininet/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/wininet/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -1,3 +1,5 @@ + +remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502) add_definitions( -D__ROS_LONG64__ Modified: branches/GSoC_2011/KMTestSuite/winetests/winmm/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/winmm/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/winmm/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -17,3 +17,7 @@ set_module_type(winmm_winetest win32cui) add_importlibs(winmm_winetest winmm user32 msvcrt kernel32 ntdll) add_cd_file(TARGET winmm_winetest DESTINATION reactos/bin FOR all) + +if(NOT MSVC) + allow_warnings(winmm_winetest) +endif() Modified: branches/GSoC_2011/KMTestSuite/winetests/ws2_32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/winetests…
============================================================================== --- branches/GSoC_2011/KMTestSuite/winetests/ws2_32/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/winetests/ws2_32/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:28:02 2011 @@ -8,3 +8,7 @@ set_module_type(ws2_32_winetest win32cui) add_importlibs(ws2_32_winetest ws2_32 user32 msvcrt kernel32 ntdll) add_cd_file(TARGET ws2_32_winetest DESTINATION reactos/bin FOR all) + +if(NOT MSVC) + allow_warnings(ws2_32_winetest) +endif()
13 years, 3 months
1
0
0
0
[tfaber] 53637: [KMTESTS] - Use new CMake macros in separate drivers, too - Use kmtest_.exe filename for rbuild too
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Sep 8 10:25:40 2011 New Revision: 53637 URL:
http://svn.reactos.org/svn/reactos?rev=53637&view=rev
Log: [KMTESTS] - Use new CMake macros in separate drivers, too - Use kmtest_.exe filename for rbuild too Modified: branches/GSoC_2011/KMTestSuite/kmtests/example/CMakeLists.txt branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/CMakeLists.txt Modified: branches/GSoC_2011/KMTestSuite/kmtests/example/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/e…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/example/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/example/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:25:40 2011 @@ -10,6 +10,7 @@ set_module_type(example_drv kernelmodedriver) target_link_libraries(example_drv kmtest_printf ${PSEH_LIB}) add_importlibs(example_drv ntoskrnl hal) -set_property(TARGET example_drv PROPERTY COMPILE_DEFINITIONS KMT_STANDALONE_DRIVER) +add_target_compile_definitions(example_drv KMT_STANDALONE_DRIVER) +#add_pch(example_drv ../include/kmt_test.h) add_cd_file(TARGET example_drv DESTINATION reactos/bin FOR all) Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild [iso-8859-1] Thu Sep 8 10:25:40 2011 @@ -1,4 +1,4 @@ -<module name="kmtest" type="win32cui" installbase="bin" installname="kmtest.exe"> +<module name="kmtest" type="win32cui" installbase="bin" installname="kmtest_.exe"> <include base="kmtest">include</include> <library>advapi32</library> <library>ntdll</library> Modified: branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/n…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/CMakeLists.txt [iso-8859-1] Thu Sep 8 10:25:40 2011 @@ -13,7 +13,8 @@ set_module_type(iodeviceobject_drv kernelmodedriver) target_link_libraries(iodeviceobject_drv kmtest_printf ${PSEH_LIB}) add_importlibs(iodeviceobject_drv ntoskrnl hal) -set_property(TARGET iodeviceobject_drv PROPERTY COMPILE_DEFINITIONS KMT_STANDALONE_DRIVER) +add_target_compile_definitions(iodeviceobject_drv KMT_STANDALONE_DRIVER) +#add_pch(iodeviceobject_drv ../include/kmt_test.h) add_cd_file(TARGET iodeviceobject_drv DESTINATION reactos/bin FOR all) @@ -29,6 +30,7 @@ set_module_type(iohelper_drv kernelmodedriver) target_link_libraries(iohelper_drv kmtest_printf ${PSEH_LIB}) add_importlibs(iohelper_drv ntoskrnl hal) -set_property(TARGET iohelper_drv PROPERTY COMPILE_DEFINITIONS KMT_STANDALONE_DRIVER) +add_target_compile_definitions(iohelper_drv KMT_STANDALONE_DRIVER) +#add_pch(iohelper_drv ../include/kmt_test.h) add_cd_file(TARGET iohelper_drv DESTINATION reactos/bin FOR all)
13 years, 3 months
1
0
0
0
[rharabien] 53636: [WIN32K] - Fix user32:monitor winetest failures (ClipCursor bugs) - Protect functions in accelerator.c with SEH
by rharabien@svn.reactos.org
Author: rharabien Date: Thu Sep 8 09:55:28 2011 New Revision: 53636 URL:
http://svn.reactos.org/svn/reactos?rev=53636&view=rev
Log: [WIN32K] - Fix user32:monitor winetest failures (ClipCursor bugs) - Protect functions in accelerator.c with SEH Modified: trunk/reactos/subsystems/win32/win32k/ntuser/accelerator.c trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/accelerator.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/accelerator.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/accelerator.c [iso-8859-1] Thu Sep 8 09:55:28 2011 @@ -309,21 +309,32 @@ Ret = 0; - while (!Done) - { - if (Entries) + _SEH2_TRY + { + ProbeForWrite(Entries, EntriesCount*sizeof(Entries[0]), 4); + + while (!Done) { - Entries[Ret].fVirt = Accel->Table[Ret].fVirt & 0x7f; - Entries[Ret].key = Accel->Table[Ret].key; - Entries[Ret].cmd = Accel->Table[Ret].cmd; - - if(Ret + 1 == EntriesCount) Done = TRUE; + if (Entries) + { + Entries[Ret].fVirt = Accel->Table[Ret].fVirt & 0x7f; + Entries[Ret].key = Accel->Table[Ret].key; + Entries[Ret].cmd = Accel->Table[Ret].cmd; + + if(Ret + 1 == EntriesCount) Done = TRUE; + } + + if((Accel->Table[Ret].fVirt & 0x80) != 0) Done = TRUE; + + Ret++; } - - if((Accel->Table[Ret].fVirt & 0x80) != 0) Done = TRUE; - - Ret++; - } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + SetLastNtError(_SEH2_GetExceptionCode()); + Ret = 0; + } + _SEH2_END; RETURN(Ret); @@ -342,6 +353,7 @@ PACCELERATOR_TABLE Accel; HACCEL hAccel; INT Index; + NTSTATUS Status = STATUS_SUCCESS; DECLARE_RETURN(HACCEL); TRACE("Enter NtUserCreateAcceleratorTable(Entries %p, EntriesCount %d)\n", @@ -374,23 +386,42 @@ RETURN( (HACCEL) NULL); } - for (Index = 0; Index < EntriesCount; Index++) - { - Accel->Table[Index].fVirt = Entries[Index].fVirt&0x7f; - if(Accel->Table[Index].fVirt & FVIRTKEY) + _SEH2_TRY + { + ProbeForRead(Entries, EntriesCount * sizeof(ACCEL), 4); + + for (Index = 0; Index < EntriesCount; Index++) { - Accel->Table[Index].key = Entries[Index].key; + Accel->Table[Index].fVirt = Entries[Index].fVirt&0x7f; + if(Accel->Table[Index].fVirt & FVIRTKEY) + { + Accel->Table[Index].key = Entries[Index].key; + } + else + { + RtlMultiByteToUnicodeN(&Accel->Table[Index].key, + sizeof(WCHAR), + NULL, + (PCSTR)&Entries[Index].key, + sizeof(CHAR)); + } + + Accel->Table[Index].cmd = Entries[Index].cmd; } - else - { - RtlMultiByteToUnicodeN(&Accel->Table[Index].key, - sizeof(WCHAR), - NULL, - (PCSTR)&Entries[Index].key, - sizeof(CHAR)); - } - - Accel->Table[Index].cmd = Entries[Index].cmd; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (!NT_SUCCESS(Status)) + { + ExFreePoolWithTag(Accel->Table, USERTAG_ACCEL); + UserDereferenceObject(Accel); + UserDeleteObject(hAccel, otAccel); + SetLastNtError(Status); + RETURN( (HACCEL) NULL); } /* Set the end-of-table terminator. */ @@ -450,28 +481,41 @@ NtUserTranslateAccelerator( HWND hWnd, HACCEL hAccel, - LPMSG Message) + LPMSG pUnsafeMessage) { PWND Window = NULL; PACCELERATOR_TABLE Accel = NULL; ULONG i; + MSG Message; USER_REFERENCE_ENTRY AccelRef, WindowRef; DECLARE_RETURN(int); TRACE("NtUserTranslateAccelerator(hWnd %x, Table %x, Message %p)\n", - hWnd, hAccel, Message); + hWnd, hAccel, pUnsafeMessage); UserEnterShared(); - if (Message == NULL) + if (pUnsafeMessage == NULL) { SetLastNtError(STATUS_INVALID_PARAMETER); RETURN( 0); } - if ((Message->message != WM_KEYDOWN) && - (Message->message != WM_SYSKEYDOWN) && - (Message->message != WM_SYSCHAR) && - (Message->message != WM_CHAR)) + _SEH2_TRY + { + ProbeForRead(pUnsafeMessage, sizeof(MSG), 4); + RtlCopyMemory(&Message, pUnsafeMessage, sizeof(MSG)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + SetLastNtError(_SEH2_GetExceptionCode()); + _SEH2_YIELD(RETURN( 0)); + } + _SEH2_END; + + if ((Message.message != WM_KEYDOWN) && + (Message.message != WM_SYSKEYDOWN) && + (Message.message != WM_SYSCHAR) && + (Message.message != WM_CHAR)) { RETURN( 0); } @@ -490,17 +534,16 @@ UserRefObjectCo(Window, &WindowRef); - /* FIXME: Associate AcceleratorTable with the current thread */ for (i = 0; i < Accel->Count; i++) { - if (co_IntTranslateAccelerator(Window, Message->message, Message->wParam, Message->lParam, + if (co_IntTranslateAccelerator(Window, Message.message, Message.wParam, Message.lParam, Accel->Table[i].fVirt, Accel->Table[i].key, Accel->Table[i].cmd)) { TRACE("NtUserTranslateAccelerator(hWnd %x, Table %x, Message %p) = %i end\n", - hWnd, hAccel, Message, 1); + hWnd, hAccel, pUnsafeMessage, 1); RETURN( 1); } if (((Accel->Table[i].fVirt & 0x80) > 0)) @@ -516,7 +559,7 @@ if (Accel) UserDerefObjectCo(Accel); TRACE("NtUserTranslateAccelerator(hWnd %x, Table %x, Message %p) = %i end\n", - hWnd, hAccel, Message, 0); + hWnd, hAccel, pUnsafeMessage, 0); UserLeave(); END_CLEANUP; } Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] Thu Sep 8 09:55:28 2011 @@ -564,13 +564,29 @@ DesktopWindow = UserGetDesktopWindow(); - if (prcl != NULL && - (prcl->right > prcl->left) && - (prcl->bottom > prcl->top) && - DesktopWindow != NULL) - { + if (prcl != NULL && DesktopWindow != NULL) + { + if (prcl->right < prcl->left || prcl->bottom < prcl->top) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + CurInfo->bClipped = TRUE; - RECTL_bIntersectRect(&CurInfo->rcClip, prcl, &DesktopWindow->rcWindow); + + /* Set nw cliping region. Note: we can't use RECTL_bIntersectRect because + it sets rect to 0 0 0 0 when it's empty. For more info see monitor winetest */ + CurInfo->rcClip.left = max(prcl->left, DesktopWindow->rcWindow.left); + CurInfo->rcClip.right = min(prcl->right, DesktopWindow->rcWindow.right); + if (CurInfo->rcClip.right < CurInfo->rcClip.left) + CurInfo->rcClip.right = CurInfo->rcClip.left; + + CurInfo->rcClip.top = max(prcl->top, DesktopWindow->rcWindow.top); + CurInfo->rcClip.bottom = min(prcl->bottom, DesktopWindow->rcWindow.bottom); + if (CurInfo->rcClip.bottom < CurInfo->rcClip.top) + CurInfo->rcClip.bottom = CurInfo->rcClip.top; + + /* Make sure cursor is in clipping region */ UserSetCursorPos(gpsi->ptCursor.x, gpsi->ptCursor.y, 0, 0, FALSE); } else
13 years, 3 months
1
0
0
0
[fireball] 53635: - Downgrade some DPRINT1s to DPRINTs.
by fireball@svn.reactos.org
Author: fireball Date: Thu Sep 8 08:28:41 2011 New Revision: 53635 URL:
http://svn.reactos.org/svn/reactos?rev=53635&view=rev
Log: - Downgrade some DPRINT1s to DPRINTs. Modified: trunk/reactos/dll/ntdll/ldr/ldrapi.c trunk/reactos/dll/ntdll/ldr/ldrinit.c trunk/reactos/ntoskrnl/mm/ARM3/procsup.c trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c Modified: trunk/reactos/dll/ntdll/ldr/ldrapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrapi.c?rev…
============================================================================== --- trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] Thu Sep 8 08:28:41 2011 @@ -1542,8 +1542,8 @@ NTAPI LdrUnloadAlternateResourceModule(IN PVOID BaseAddress) { - static BOOLEAN WarnedOnce = FALSE; - if (WarnedOnce == FALSE) { UNIMPLEMENTED; WarnedOnce = TRUE; } + //static BOOLEAN WarnedOnce = FALSE; + //if (WarnedOnce == FALSE) { UNIMPLEMENTED; WarnedOnce = TRUE; } return FALSE; } Modified: trunk/reactos/dll/ntdll/ldr/ldrinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrinit.c?re…
============================================================================== --- trunk/reactos/dll/ntdll/ldr/ldrinit.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/ldrinit.c [iso-8859-1] Thu Sep 8 08:28:41 2011 @@ -728,7 +728,7 @@ /* Clear it */ //Kernel32ProcessInitPostImportfunction = NULL; - UNIMPLEMENTED; + //UNIMPLEMENTED; } /* No root entry? return */ @@ -1988,7 +1988,7 @@ if (NtHeader->OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) { /* Load kernel32 and call BasePostImportInit... */ - DPRINT1("Unimplemented codepath!\n"); + DPRINT("Unimplemented codepath!\n"); } /* Walk the IAT and load all the DLLs */ @@ -2095,7 +2095,7 @@ { /* Check for Application Compatibility Goo */ //LdrQueryApplicationCompatibilityGoo(hKey); - DPRINT1("Querying app compat hacks is missing!\n"); + DPRINT("Querying app compat hacks is missing!\n"); } /* Modified: trunk/reactos/ntoskrnl/mm/ARM3/procsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/procsup.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] Thu Sep 8 08:28:41 2011 @@ -590,7 +590,7 @@ ViewShare, MEM_TOP_DOWN, PAGE_READONLY); - DPRINT1("NLS Tables at: %p\n", TableBase); + DPRINT("NLS Tables at: %p\n", TableBase); if (!NT_SUCCESS(Status)) { /* Cleanup and exit */ @@ -602,7 +602,7 @@ // Allocate the PEB // Status = MiCreatePebOrTeb(Process, sizeof(PEB), (PULONG_PTR)&Peb); - DPRINT1("PEB at: %p\n", Peb); + DPRINT("PEB at: %p\n", Peb); if (!NT_SUCCESS(Status)) { /* Cleanup and exit */ Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c [iso-8859-1] Thu Sep 8 08:28:41 2011 @@ -105,7 +105,7 @@ PROCESS_ALL_ACCESS, &ObjectAttributes, &ClientId); - DPRINT1("CSR Process: %p Handle: %p\n", pProcessData, pProcessData->Process); + DPRINT("CSR Process: %p Handle: %p\n", pProcessData, pProcessData->Process); if (!NT_SUCCESS(Status)) { ProcessData[hash] = pProcessData->next; Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c [iso-8859-1] Thu Sep 8 08:28:41 2011 @@ -278,8 +278,8 @@ /* Check if we have a process */ if (CsrProcess) { - /* Map the sectio into this process */ - DPRINT1("CSR Process Handle: %p. CSR Process: %p\n", CsrProcess->Process, CsrProcess); + /* Map the section into this process */ + DPRINT("CSR Process Handle: %p. CSR Process: %p\n", CsrProcess->Process, CsrProcess); Status = NtMapViewOfSection(CsrSrvSharedSection, CsrProcess->Process, &CsrSrvSharedSectionBase, @@ -520,7 +520,7 @@ Status = CsrSrvAttachSharedSection(ProcessData, ConnectInfo); if (NT_SUCCESS(Status)) { - DPRINT1("Connection ok\n"); + DPRINT("Connection ok\n"); AllowConnection = TRUE; } else
13 years, 3 months
1
0
0
0
[tkreuzer] 53634: [HAL] - Fix I/O APIC register access - set APIC logical id based on Cpu (currently flat model with up to 8 cpus supported) - In HalpInitializeTsc, setup the RTC clock, since the t...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Sep 8 08:15:39 2011 New Revision: 53634 URL:
http://svn.reactos.org/svn/reactos?rev=53634&view=rev
Log: [HAL] - Fix I/O APIC register access - set APIC logical id based on Cpu (currently flat model with up to 8 cpus supported) - In HalpInitializeTsc, setup the RTC clock, since the timer is initialized later - in the TSC calibration ISR, send EOI and read RTC register C to get the next interrupt Modified: trunk/reactos/hal/halx86/apic/apic.c trunk/reactos/hal/halx86/apic/apic.h trunk/reactos/hal/halx86/apic/rtctimer.c trunk/reactos/hal/halx86/apic/tsc.c trunk/reactos/hal/halx86/apic/tsccal.S Modified: trunk/reactos/hal/halx86/apic/apic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/apic/apic.c?rev…
============================================================================== --- trunk/reactos/hal/halx86/apic/apic.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/apic/apic.c [iso-8859-1] Thu Sep 8 08:15:39 2011 @@ -88,7 +88,7 @@ IOApicRead(UCHAR Register) { /* Select the register, then do the read */ - *(volatile ULONG *)(IOAPIC_BASE + IOAPIC_IOREGSEL) = Register; + *(volatile UCHAR *)(IOAPIC_BASE + IOAPIC_IOREGSEL) = Register; return *(volatile ULONG *)(IOAPIC_BASE + IOAPIC_IOWIN); } @@ -97,7 +97,7 @@ IOApicWrite(UCHAR Register, ULONG Value) { /* Select the register, then do the write */ - *(volatile ULONG *)(IOAPIC_BASE + IOAPIC_IOREGSEL) = Register; + *(volatile UCHAR *)(IOAPIC_BASE + IOAPIC_IOREGSEL) = Register; *(volatile ULONG *)(IOAPIC_BASE + IOAPIC_IOWIN) = Value; } @@ -240,6 +240,12 @@ SpIntRegister.SoftwareEnable = 1; SpIntRegister.FocusCPUCoreChecking = 0; ApicWrite(APIC_SIVR, SpIntRegister.Long); + + /* Set the mode to flat (max 8 CPUs supported!) */ + ApicWrite(APIC_DFR, APIC_DF_Flat); + + /* Set logical apic ID */ + ApicWrite(APIC_LDR, ApicLogicalId(Cpu) << 24); /* Set the spurious ISR */ KeRegisterInterruptHandler(APIC_SPURIOUS_VECTOR, ApicSpuriousService); @@ -409,9 +415,11 @@ /* Enable the timer interrupt */ ReDirReg.Vector = APIC_CLOCK_VECTOR; - ReDirReg.DestinationMode = APIC_DM_Logical; + ReDirReg.DeliveryMode = APIC_MT_Fixed; + ReDirReg.DestinationMode = APIC_DM_Physical; ReDirReg.TriggerMode = APIC_TGM_Edge; ReDirReg.Mask = 0; + ReDirReg.Destination = ApicRead(APIC_ID); IOApicWrite(IOAPIC_REDTBL + 2 * APIC_CLOCK_INDEX, ReDirReg.Long0); } @@ -519,6 +527,7 @@ IN KINTERRUPT_MODE InterruptMode) { IOAPIC_REDIRECTION_REGISTER ReDirReg; + PKPRCB Prcb = KeGetCurrentPrcb(); UCHAR Index; ASSERT(Irql <= HIGH_LEVEL); ASSERT((IrqlToTpr(Irql) & 0xF0) == (Vector & 0xF0)); @@ -531,6 +540,7 @@ ReDirReg.Vector = Vector; ReDirReg.DeliveryMode = APIC_MT_LowestPriority; ReDirReg.DestinationMode = APIC_DM_Logical; + ReDirReg.Destination |= ApicLogicalId(Prcb->Number); ReDirReg.TriggerMode = 1 - InterruptMode; ReDirReg.Mask = FALSE; @@ -560,6 +570,14 @@ /* Write back lower dword */ IOApicWrite(IOAPIC_REDTBL + 2 * Irql, ReDirReg.Long0); +} + +VOID +NTAPI +HalpSendEOI(VOID) +{ + /* Write 0 to the EndOfInterruptRegister */ + ApicWrite(APIC_EOI, 0); } #ifndef _M_AMD64 @@ -592,7 +610,7 @@ /* Restore the old IRQL */ ApicSetCurrentIrql(OldIrql); - /* Write 0 to the EndOfInterruptRegister for level triggered ints */ + /* Write 0 to the EndOfInterruptRegister */ ApicWrite(APIC_EOI, 0); } Modified: trunk/reactos/hal/halx86/apic/apic.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/apic/apic.h?rev…
============================================================================== --- trunk/reactos/hal/halx86/apic/apic.h [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/apic/apic.h [iso-8859-1] Thu Sep 8 08:15:39 2011 @@ -39,6 +39,7 @@ #define IOAPIC_PHYS_BASE 0xFEC00000 #define APIC_CLOCK_INDEX 8 +#define ApicLogicalId(Cpu) ((UCHAR)(1<< Cpu)) /* APIC Register Address Map */ #define APIC_ID 0x0020 /* Local APIC ID Register (R/W) */ @@ -108,6 +109,12 @@ enum { + APIC_DF_Flat = 0xFFFFFFFF, + APIC_DF_Cluster = 0x0FFFFFFF +}; + +enum +{ TIMER_DV_DivideBy2 = 0, TIMER_DV_DivideBy4 = 1, TIMER_DV_DivideBy8 = 2, @@ -224,7 +231,7 @@ IOAPIC_ID = 0x00, IOAPIC_VER = 0x01, IOAPIC_ARB = 0x02, - IOAPIC_REDTBL = 0x28 + IOAPIC_REDTBL = 0x10 }; typedef union _IOAPIC_REDIRECTION_REGISTER Modified: trunk/reactos/hal/halx86/apic/rtctimer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/apic/rtctimer.c…
============================================================================== --- trunk/reactos/hal/halx86/apic/rtctimer.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/apic/rtctimer.c [iso-8859-1] Thu Sep 8 08:15:39 2011 @@ -83,7 +83,9 @@ /* Release CMOS lock */ HalpReleaseCmosSpinLock(); - // RtcSetClockRate(HalpCurrentRate); + RtcSetClockRate(HalpCurrentRate); + + DPRINT1("Clock initialized\n"); } VOID @@ -95,7 +97,6 @@ /* Enter trap */ KiEnterInterruptTrap(TrapFrame); -__debugbreak(); /* Start the interrupt */ if (HalBeginSystemInterrupt(CLOCK_LEVEL, PRIMARY_VECTOR_BASE, &Irql)) Modified: trunk/reactos/hal/halx86/apic/tsc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/apic/tsc.c?rev=…
============================================================================== --- trunk/reactos/hal/halx86/apic/tsc.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/apic/tsc.c [iso-8859-1] Thu Sep 8 08:15:39 2011 @@ -18,7 +18,7 @@ UCHAR TscCalibrationPhase; LARGE_INTEGER TscCalibrationArray[NUM_SAMPLES]; -extern const UCHAR HalpClockVector; +UCHAR HalpRtcClockVector = 0xD1; /* PRIVATE FUNCTIONS *********************************************************/ @@ -29,6 +29,7 @@ ULONG_PTR Flags; KIDTENTRY OldIdtEntry, *IdtPointer; PKPCR Pcr = KeGetPcr(); + UCHAR RegisterA, RegisterB; /* Check if the CPU supports RDTSC */ if (!(KeGetCurrentPrcb()->FeatureBits & KF_RDTSC)) @@ -40,31 +41,41 @@ Flags = __readeflags(); _disable(); -__debugbreak(); + /* Enable the periodic interrupt in the CMOS */ + RegisterB = HalpReadCmos(RTC_REGISTER_B); + HalpWriteCmos(RTC_REGISTER_B, RegisterB | RTC_REG_B_PI); - /* Initialze the PIT */ - //HalpInitializePIT(); + /* Modify register A to get 4096 Hz */ + RegisterA = HalpReadCmos(RTC_REGISTER_A); + RegisterA = (RegisterA & 0xF0) | 9; + HalpWriteCmos(RTC_REGISTER_A, RegisterA); /* Save old IDT entry */ - IdtPointer = KiGetIdtEntry(Pcr, HalpClockVector); + IdtPointer = KiGetIdtEntry(Pcr, HalpRtcClockVector); OldIdtEntry = *IdtPointer; /* Set the calibration ISR */ - KeRegisterInterruptHandler(HalpClockVector, TscCalibrationISR); + KeRegisterInterruptHandler(HalpRtcClockVector, TscCalibrationISR); /* Reset TSC value to 0 */ __writemsr(MSR_RDTSC, 0); /* Enable the timer interupt */ - HalEnableSystemInterrupt(HalpClockVector, CLOCK_LEVEL, Latched); + HalEnableSystemInterrupt(HalpRtcClockVector, CLOCK_LEVEL, Latched); + + /* Read register C, so that the next interrupt can happen */ + HalpReadCmos(RTC_REGISTER_C);; /* Wait for completion */ _enable(); while (TscCalibrationPhase < NUM_SAMPLES) _ReadWriteBarrier(); _disable(); + /* Disable the periodic interrupt in the CMOS */ + HalpWriteCmos(RTC_REGISTER_B, RegisterB & ~RTC_REG_B_PI); + /* Disable the timer interupt */ - HalDisableSystemInterrupt(HalpClockVector, CLOCK_LEVEL); + HalDisableSystemInterrupt(HalpRtcClockVector, CLOCK_LEVEL); /* Restore old IDT entry */ *IdtPointer = OldIdtEntry; Modified: trunk/reactos/hal/halx86/apic/tsccal.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/apic/tsccal.S?r…
============================================================================== --- trunk/reactos/hal/halx86/apic/tsccal.S [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/apic/tsccal.S [iso-8859-1] Thu Sep 8 08:15:39 2011 @@ -8,6 +8,7 @@ EXTERN _TscCalibrationPhase:BYTE EXTERN _TscCalibrationArray:QWORD +EXTERN _HalpSendEOI@0:PROC PUBLIC _TscCalibrationISR _TscCalibrationISR: @@ -26,13 +27,25 @@ jnb _CalibrationISR_Exit /* Store the current value */ - mov dword ptr _TscCalibrationArray[ecx * 2], eax - mov dword ptr _TscCalibrationArray[ecx * 2 + 4], edx + shl ecx, 3 + mov dword ptr _TscCalibrationArray[ecx], eax + mov dword ptr _TscCalibrationArray[ecx + 4], edx /* Advance phase */ inc byte ptr ds:[_TscCalibrationPhase] _CalibrationISR_Exit: + + /* Read CMOS register C */ + mov al, HEX(0C) + out HEX(70), al + jmp $+2 + in al, HEX(71) + jmp $+2 + + /* Send EOI */ + call _HalpSendEOI@0 + pop edx pop ecx pop eax
13 years, 3 months
1
0
0
0
[cmihail] 53633: [shell32.dll] - Initialize uninitialized variables. - Add code to guard against potential NULL pointer dereferencing. Thanks to Amine Khaldi for pointing out all these.
by cmihail@svn.reactos.org
Author: cmihail Date: Wed Sep 7 23:21:02 2011 New Revision: 53633 URL:
http://svn.reactos.org/svn/reactos?rev=53633&view=rev
Log: [shell32.dll] - Initialize uninitialized variables. - Add code to guard against potential NULL pointer dereferencing. Thanks to Amine Khaldi for pointing out all these. Modified: branches/shell32_new-bringup/dll/win32/shell32/autocomplete.cpp branches/shell32_new-bringup/dll/win32/shell32/classes.cpp branches/shell32_new-bringup/dll/win32/shell32/debughlp.cpp branches/shell32_new-bringup/dll/win32/shell32/dialogs.cpp branches/shell32_new-bringup/dll/win32/shell32/enumidlist.cpp branches/shell32_new-bringup/dll/win32/shell32/shfldr_mycomp.cpp branches/shell32_new-bringup/dll/win32/shell32/shfldr_printers.cpp branches/shell32_new-bringup/dll/win32/shell32/shlexec.cpp branches/shell32_new-bringup/dll/win32/shell32/shv_def_cmenu.cpp branches/shell32_new-bringup/dll/win32/shell32/shv_item_new.cpp branches/shell32_new-bringup/dll/win32/shell32/shv_item_new.h Modified: branches/shell32_new-bringup/dll/win32/shell32/autocomplete.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
============================================================================== --- branches/shell32_new-bringup/dll/win32/shell32/autocomplete.cpp [iso-8859-1] (original) +++ branches/shell32_new-bringup/dll/win32/shell32/autocomplete.cpp [iso-8859-1] Wed Sep 7 23:21:02 2011 @@ -1,8 +1,8 @@ /* - * AutoComplete interfaces implementation. + * AutoComplete interfaces implementation. * - * Copyright 2004 Maxime Bellengé <maxime.bellenge(a)laposte.net> - * Copyright 2009 Andrew Hill + * Copyright 2004 Maxime Bellengé <maxime.bellenge(a)laposte.net> + * Copyright 2009 Andrew Hill * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -44,12 +44,12 @@ */ CAutoComplete::CAutoComplete() { - enabled = TRUE; - options = ACO_AUTOAPPEND; - wpOrigEditProc = NULL; - hwndListBox = NULL; - txtbackup = NULL; - quickComplete = NULL; + enabled = TRUE; + options = ACO_AUTOAPPEND; + wpOrigEditProc = NULL; + hwndListBox = NULL; + txtbackup = NULL; + quickComplete = NULL; hwndEdit = NULL; wpOrigLBoxProc = NULL; } @@ -59,11 +59,11 @@ */ CAutoComplete::~CAutoComplete() { - TRACE(" destroying IAutoComplete(%p)\n", this); - HeapFree(GetProcessHeap(), 0, quickComplete); - HeapFree(GetProcessHeap(), 0, txtbackup); - if (hwndListBox) - DestroyWindow(hwndListBox); + TRACE(" destroying IAutoComplete(%p)\n", this); + HeapFree(GetProcessHeap(), 0, quickComplete); + HeapFree(GetProcessHeap(), 0, txtbackup); + if (hwndListBox) + DestroyWindow(hwndListBox); } /****************************************************************************** @@ -88,7 +88,7 @@ static const WCHAR lbName[] = {'L','i','s','t','B','o','x',0}; TRACE("(%p)->(0x%08lx, %p, %s, %s)\n", - this, hwndEdit, punkACL, debugstr_w(pwzsRegKeyPath), debugstr_w(pwszQuickComplete)); + this, hwndEdit, punkACL, debugstr_w(pwzsRegKeyPath), debugstr_w(pwszQuickComplete)); if (options & ACO_AUTOSUGGEST) TRACE(" ACO_AUTOSUGGEST\n"); @@ -105,12 +105,12 @@ if (options & ACO_RTLREADING) FIXME(" ACO_RTLREADING not supported\n"); - hwndEdit = hwndEdit; - - if (!SUCCEEDED (punkACL->QueryInterface(IID_IEnumString, (LPVOID *)&enumstr))) - { - TRACE("No IEnumString interface\n"); - return E_NOINTERFACE; + hwndEdit = hwndEdit; + + if (!SUCCEEDED (punkACL->QueryInterface(IID_IEnumString, (LPVOID *)&enumstr))) + { + TRACE("No IEnumString interface\n"); + return E_NOINTERFACE; } wpOrigEditProc = (WNDPROC)SetWindowLongPtrW(hwndEdit, GWLP_WNDPROC, (LONG_PTR) ACEditSubclassProc); @@ -118,65 +118,88 @@ if (options & ACO_AUTOSUGGEST) { - HWND hwndParent; - - hwndParent = GetParent(hwndEdit); - - /* FIXME : The listbox should be resizable with the mouse. WS_THICKFRAME looks ugly */ - hwndListBox = CreateWindowExW(0, lbName, NULL, - WS_BORDER | WS_CHILD | WS_VSCROLL | LBS_HASSTRINGS | LBS_NOTIFY | LBS_NOINTEGRALHEIGHT, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - hwndParent, NULL, - (HINSTANCE)GetWindowLongPtrW(hwndParent, GWLP_HINSTANCE), NULL); + HWND hwndParent; + + hwndParent = GetParent(hwndEdit); + + /* FIXME : The listbox should be resizable with the mouse. WS_THICKFRAME looks ugly */ + hwndListBox = CreateWindowExW(0, lbName, NULL, + WS_BORDER | WS_CHILD | WS_VSCROLL | LBS_HASSTRINGS | LBS_NOTIFY | LBS_NOINTEGRALHEIGHT, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + hwndParent, NULL, + (HINSTANCE)GetWindowLongPtrW(hwndParent, GWLP_HINSTANCE), NULL); if (hwndListBox) { - wpOrigLBoxProc = (WNDPROC)SetWindowLongPtrW(hwndListBox, GWLP_WNDPROC, (LONG_PTR)ACLBoxSubclassProc); - SetWindowLongPtrW(hwndListBox, GWLP_USERDATA, (LONG_PTR)this); - } - } + wpOrigLBoxProc = (WNDPROC)SetWindowLongPtrW(hwndListBox, GWLP_WNDPROC, (LONG_PTR)ACLBoxSubclassProc); + SetWindowLongPtrW(hwndListBox, GWLP_USERDATA, (LONG_PTR)this); + } + } if (pwzsRegKeyPath) { - WCHAR *key; - WCHAR result[MAX_PATH]; - WCHAR *value; - HKEY hKey = 0; - LONG res; - LONG len; - - /* pwszRegKeyPath contains the key as well as the value, so we split */ - key = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (wcslen(pwzsRegKeyPath) + 1) * sizeof(WCHAR)); - wcscpy(key, pwzsRegKeyPath); - value = const_cast<WCHAR *>(strrchrW(key, '\\')); - *value = 0; - value++; - /* Now value contains the value and buffer the key */ - res = RegOpenKeyExW(HKEY_CURRENT_USER, key, 0, KEY_READ, &hKey); - - if (res != ERROR_SUCCESS) - { - /* if the key is not found, MSDN states we must seek in HKEY_LOCAL_MACHINE */ - res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, key, 0, KEY_READ, &hKey); - } - - if (res == ERROR_SUCCESS) - { - res = RegQueryValueW(hKey, value, result, &len); - if (res == ERROR_SUCCESS) - { - quickComplete = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(WCHAR)); - wcscpy(quickComplete, result); - } - RegCloseKey(hKey); - } - HeapFree(GetProcessHeap(), 0, key); + WCHAR *key; + WCHAR result[MAX_PATH]; + WCHAR *value; + HKEY hKey = 0; + LONG res; + LONG len; + + /* pwszRegKeyPath contains the key as well as the value, so we split */ + key = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (wcslen(pwzsRegKeyPath) + 1) * sizeof(WCHAR)); + + if (key) + { + wcscpy(key, pwzsRegKeyPath); + value = const_cast<WCHAR *>(strrchrW(key, '\\')); + + if (value) + { + *value = 0; + value++; + /* Now value contains the value and buffer the key */ + res = RegOpenKeyExW(HKEY_CURRENT_USER, key, 0, KEY_READ, &hKey); + + if (res != ERROR_SUCCESS) + { + /* if the key is not found, MSDN states we must seek in HKEY_LOCAL_MACHINE */ + res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, key, 0, KEY_READ, &hKey); + } + + if (res == ERROR_SUCCESS) + { + res = RegQueryValueW(hKey, value, result, &len); + if (res == ERROR_SUCCESS) + { + quickComplete = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(WCHAR)); + wcscpy(quickComplete, result); + } + RegCloseKey(hKey); + } + } + + HeapFree(GetProcessHeap(), 0, key); + } + else + { + TRACE("HeapAlloc Failed when trying to alloca %d bytes\n", (wcslen(pwzsRegKeyPath) + 1) * sizeof(WCHAR)); + return S_FALSE; + } } if ((pwszQuickComplete) && (!quickComplete)) { - quickComplete = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (wcslen(pwszQuickComplete) + 1) * sizeof(WCHAR)); - wcscpy(quickComplete, pwszQuickComplete); + quickComplete = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (wcslen(pwszQuickComplete) + 1) * sizeof(WCHAR)); + + if (quickComplete) + { + wcscpy(quickComplete, pwszQuickComplete); + } + else + { + TRACE("HeapAlloc Failed when trying to alloca %d bytes\n", (wcslen(pwszQuickComplete) + 1) * sizeof(WCHAR)); + return S_FALSE; + } } return S_OK; @@ -215,7 +238,7 @@ */ LRESULT APIENTRY CAutoComplete::ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - CAutoComplete *pThis = (CAutoComplete *)GetWindowLongPtrW(hwnd, GWLP_USERDATA); + CAutoComplete *pThis = (CAutoComplete *)GetWindowLongPtrW(hwnd, GWLP_USERDATA); LPOLESTR strs; HRESULT hr; WCHAR hwndText[255]; @@ -231,203 +254,218 @@ switch (uMsg) { - case CB_SHOWDROPDOWN: - { - ShowWindow(pThis->hwndListBox, SW_HIDE); + case CB_SHOWDROPDOWN: + { + ShowWindow(pThis->hwndListBox, SW_HIDE); }; break; - case WM_KILLFOCUS: - { - if ((pThis->options & ACO_AUTOSUGGEST) && ((HWND)wParam != pThis->hwndListBox)) - { - ShowWindow(pThis->hwndListBox, SW_HIDE); - } + case WM_KILLFOCUS: + { + if ((pThis->options & ACO_AUTOSUGGEST) && ((HWND)wParam != pThis->hwndListBox)) + { + ShowWindow(pThis->hwndListBox, SW_HIDE); + } return CallWindowProcW(pThis->wpOrigEditProc, hwnd, uMsg, wParam, lParam); }; break; - case WM_KEYUP: - { - GetWindowTextW(hwnd, (LPWSTR)hwndText, 255); - - switch(wParam) - { - case VK_RETURN: - { - /* If quickComplete is set and control is pressed, replace the string */ - control = GetKeyState(VK_CONTROL) & 0x8000; - if (control && pThis->quickComplete) - { - hwndQCText = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - (wcslen(pThis->quickComplete)+wcslen(hwndText))*sizeof(WCHAR)); - sel = swprintf(hwndQCText, pThis->quickComplete, hwndText); - SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)hwndQCText); - SendMessageW(hwnd, EM_SETSEL, 0, sel); - HeapFree(GetProcessHeap(), 0, hwndQCText); - } - - ShowWindow(pThis->hwndListBox, SW_HIDE); - return 0; + case WM_KEYUP: + { + GetWindowTextW(hwnd, (LPWSTR)hwndText, 255); + + switch(wParam) + { + case VK_RETURN: + { + /* If quickComplete is set and control is pressed, replace the string */ + control = GetKeyState(VK_CONTROL) & 0x8000; + if (control && pThis->quickComplete) + { + hwndQCText = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + (wcslen(pThis->quickComplete)+wcslen(hwndText))*sizeof(WCHAR)); + sel = swprintf(hwndQCText, pThis->quickComplete, hwndText); + SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)hwndQCText); + SendMessageW(hwnd, EM_SETSEL, 0, sel); + HeapFree(GetProcessHeap(), 0, hwndQCText); + } + + ShowWindow(pThis->hwndListBox, SW_HIDE); + return 0; }; break; case VK_LEFT: - case VK_RIGHT: - { - return 0; + case VK_RIGHT: + { + return 0; }; break; - case VK_UP: - case VK_DOWN: - { - /* Two cases here : - - if the listbox is not visible, displays it - with all the entries if the style ACO_UPDOWNKEYDROPSLIST - is present but does not select anything. - - if the listbox is visible, change the selection - */ - if ( (pThis->options & (ACO_AUTOSUGGEST | ACO_UPDOWNKEYDROPSLIST)) - && (!IsWindowVisible(pThis->hwndListBox) && (! *hwndText)) ) - { - /* We must display all the entries */ - displayall = TRUE; - } + case VK_UP: + case VK_DOWN: + { + /* Two cases here : + - if the listbox is not visible, displays it + with all the entries if the style ACO_UPDOWNKEYDROPSLIST + is present but does not select anything. + - if the listbox is visible, change the selection + */ + if ( (pThis->options & (ACO_AUTOSUGGEST | ACO_UPDOWNKEYDROPSLIST)) + && (!IsWindowVisible(pThis->hwndListBox) && (! *hwndText)) ) + { + /* We must display all the entries */ + displayall = TRUE; + } else { - if (IsWindowVisible(pThis->hwndListBox)) + if (IsWindowVisible(pThis->hwndListBox)) { - int count; - - count = SendMessageW(pThis->hwndListBox, LB_GETCOUNT, 0, 0); - /* Change the selection */ - sel = SendMessageW(pThis->hwndListBox, LB_GETCURSEL, 0, 0); - if (wParam == VK_UP) - sel = ((sel-1)<0)?count-1:sel-1; - else - sel = ((sel+1)>= count)?-1:sel+1; - + int count; + + count = SendMessageW(pThis->hwndListBox, LB_GETCOUNT, 0, 0); + /* Change the selection */ + sel = SendMessageW(pThis->hwndListBox, LB_GETCURSEL, 0, 0); + if (wParam == VK_UP) + sel = ((sel-1)<0)?count-1:sel-1; + else + sel = ((sel+1)>= count)?-1:sel+1; + SendMessageW(pThis->hwndListBox, LB_SETCURSEL, sel, 0); - + if (sel != -1) { - WCHAR *msg; - int len; - - len = SendMessageW(pThis->hwndListBox, LB_GETTEXTLEN, sel, (LPARAM)NULL); - msg = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len + 1) * sizeof(WCHAR)); - - SendMessageW(pThis->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg); - SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)msg); - SendMessageW(hwnd, EM_SETSEL, wcslen(msg), wcslen(msg)); - - HeapFree(GetProcessHeap(), 0, msg); - } + WCHAR *msg; + int len; + + len = SendMessageW(pThis->hwndListBox, LB_GETTEXTLEN, sel, (LPARAM)NULL); + msg = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len + 1) * sizeof(WCHAR)); + + if (msg) + { + SendMessageW(pThis->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg); + SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)msg); + SendMessageW(hwnd, EM_SETSEL, wcslen(msg), wcslen(msg)); + + HeapFree(GetProcessHeap(), 0, msg); + } + else + { + TRACE("HeapAlloc failed to allocate %d bytes\n", (len + 1) * sizeof(WCHAR)); + } + } else { - SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)pThis->txtbackup); - SendMessageW(hwnd, EM_SETSEL, wcslen(pThis->txtbackup), wcslen(pThis->txtbackup)); - } - } - return 0; - } + SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)pThis->txtbackup); + SendMessageW(hwnd, EM_SETSEL, wcslen(pThis->txtbackup), wcslen(pThis->txtbackup)); + } + } + return 0; + } }; break; - + case VK_BACK: - case VK_DELETE: - { - if ((! *hwndText) && (pThis->options & ACO_AUTOSUGGEST)) - { - ShowWindow(pThis->hwndListBox, SW_HIDE); - return CallWindowProcW(pThis->wpOrigEditProc, hwnd, uMsg, wParam, lParam); - } - + case VK_DELETE: + { + if ((! *hwndText) && (pThis->options & ACO_AUTOSUGGEST)) + { + ShowWindow(pThis->hwndListBox, SW_HIDE); + return CallWindowProcW(pThis->wpOrigEditProc, hwnd, uMsg, wParam, lParam); + } + if (pThis->options & ACO_AUTOAPPEND) { - DWORD b; - SendMessageW(hwnd, EM_GETSEL, (WPARAM)&b, (LPARAM)NULL); - if (b>1) + DWORD b; + SendMessageW(hwnd, EM_GETSEL, (WPARAM)&b, (LPARAM)NULL); + if (b>1) { - hwndText[b-1] = '\0'; - } + hwndText[b-1] = '\0'; + } else { - hwndText[0] = '\0'; - SetWindowTextW(hwnd, hwndText); - } - } + hwndText[0] = '\0'; + SetWindowTextW(hwnd, hwndText); + } + } }; break; - + default: - ; - } - - SendMessageW(pThis->hwndListBox, LB_RESETCONTENT, 0, 0); - - HeapFree(GetProcessHeap(), 0, pThis->txtbackup); - pThis->txtbackup = (WCHAR *)HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, (wcslen(hwndText)+1)*sizeof(WCHAR)); - wcscpy(pThis->txtbackup, hwndText); - - /* Returns if there is no text to search and we doesn't want to display all the entries */ - if ((!displayall) && (! *hwndText) ) - break; - - pThis->enumstr->Reset(); - filled = FALSE; - + ; + } + + SendMessageW(pThis->hwndListBox, LB_RESETCONTENT, 0, 0); + + HeapFree(GetProcessHeap(), 0, pThis->txtbackup); + + pThis->txtbackup = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (wcslen(hwndText)+1)*sizeof(WCHAR)); + + if (pThis->txtbackup) + { + wcscpy(pThis->txtbackup, hwndText); + } + else + { + TRACE("HeapAlloc failed to allocate %d bytes\n", (wcslen(hwndText)+1)*sizeof(WCHAR)); + } + + /* Returns if there is no text to search and we doesn't want to display all the entries */ + if ((!displayall) && (! *hwndText) ) + break; + + pThis->enumstr->Reset(); + filled = FALSE; + for(cpt = 0;;) { - hr = pThis->enumstr->Next(1, &strs, NULL); - if (hr != S_OK) - break; - - if ((LPWSTR)strstrW(strs, hwndText) == strs) - { - - if (pThis->options & ACO_AUTOAPPEND) - { - SetWindowTextW(hwnd, strs); - SendMessageW(hwnd, EM_SETSEL, wcslen(hwndText), wcslen(strs)); - break; - } - - if (pThis->options & ACO_AUTOSUGGEST) - { - SendMessageW(pThis->hwndListBox, LB_ADDSTRING, 0, (LPARAM)strs); - filled = TRUE; - cpt++; - } - } - } - - if (pThis->options & ACO_AUTOSUGGEST) - { - if (filled) - { - height = SendMessageW(pThis->hwndListBox, LB_GETITEMHEIGHT, 0, 0); - SendMessageW(pThis->hwndListBox, LB_CARETOFF, 0, 0); - GetWindowRect(hwnd, &r); - SetParent(pThis->hwndListBox, HWND_DESKTOP); - /* It seems that Windows XP displays 7 lines at most - and otherwise displays a vertical scroll bar */ - SetWindowPos(pThis->hwndListBox, HWND_TOP, - r.left, r.bottom + 1, r.right - r.left, min(height * 7, height * (cpt + 1)), - SWP_SHOWWINDOW ); - } + hr = pThis->enumstr->Next(1, &strs, NULL); + if (hr != S_OK) + break; + + if ((LPWSTR)strstrW(strs, hwndText) == strs) + { + + if (pThis->options & ACO_AUTOAPPEND) + { + SetWindowTextW(hwnd, strs); + SendMessageW(hwnd, EM_SETSEL, wcslen(hwndText), wcslen(strs)); + break; + } + + if (pThis->options & ACO_AUTOSUGGEST) + { + SendMessageW(pThis->hwndListBox, LB_ADDSTRING, 0, (LPARAM)strs); + filled = TRUE; + cpt++; + } + } + } + + if (pThis->options & ACO_AUTOSUGGEST) + { + if (filled) + { + height = SendMessageW(pThis->hwndListBox, LB_GETITEMHEIGHT, 0, 0); + SendMessageW(pThis->hwndListBox, LB_CARETOFF, 0, 0); + GetWindowRect(hwnd, &r); + SetParent(pThis->hwndListBox, HWND_DESKTOP); + /* It seems that Windows XP displays 7 lines at most + and otherwise displays a vertical scroll bar */ + SetWindowPos(pThis->hwndListBox, HWND_TOP, + r.left, r.bottom + 1, r.right - r.left, min(height * 7, height * (cpt + 1)), + SWP_SHOWWINDOW ); + } else { - ShowWindow(pThis->hwndListBox, SW_HIDE); - } - } + ShowWindow(pThis->hwndListBox, SW_HIDE); + } + } }; break; - + default: { - return CallWindowProcW(pThis->wpOrigEditProc, hwnd, uMsg, wParam, lParam); + return CallWindowProcW(pThis->wpOrigEditProc, hwnd, uMsg, wParam, lParam); } - } - - return 0; + } + + return 0; } LRESULT APIENTRY CAutoComplete::ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -438,33 +476,40 @@ switch (uMsg) { - case WM_MOUSEMOVE: - { - sel = SendMessageW(hwnd, LB_ITEMFROMPOINT, 0, lParam); - SendMessageW(hwnd, LB_SETCURSEL, (WPARAM)sel, (LPARAM)0); + case WM_MOUSEMOVE: + { + sel = SendMessageW(hwnd, LB_ITEMFROMPOINT, 0, lParam); + SendMessageW(hwnd, LB_SETCURSEL, (WPARAM)sel, (LPARAM)0); }; break; - + case WM_LBUTTONDOWN: { - sel = SendMessageW(hwnd, LB_GETCURSEL, 0, 0); - + sel = SendMessageW(hwnd, LB_GETCURSEL, 0, 0); + if (sel < 0) - break; - + break; + len = SendMessageW(pThis->hwndListBox, LB_GETTEXTLEN, sel, 0); - msg = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len + 1) * sizeof(WCHAR)); - - SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg); - SendMessageW(pThis->hwndEdit, WM_SETTEXT, 0, (LPARAM)msg); - SendMessageW(pThis->hwndEdit, EM_SETSEL, 0, wcslen(msg)); - ShowWindow(hwnd, SW_HIDE); - - HeapFree(GetProcessHeap(), 0, msg); - + msg = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len + 1) * sizeof(WCHAR)); + + if (msg) + { + SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg); + SendMessageW(pThis->hwndEdit, WM_SETTEXT, 0, (LPARAM)msg); + SendMessageW(pThis->hwndEdit, EM_SETSEL, 0, wcslen(msg)); + ShowWindow(hwnd, SW_HIDE); + + HeapFree(GetProcessHeap(), 0, msg); + } + else + { + TRACE("HeapAlloc failed to allocate %d bytes\n", (len + 1) * sizeof(WCHAR)); + } + }; break; - + default: - return CallWindowProcW(pThis->wpOrigLBoxProc, hwnd, uMsg, wParam, lParam); + return CallWindowProcW(pThis->wpOrigLBoxProc, hwnd, uMsg, wParam, lParam); } return 0; } Modified: branches/shell32_new-bringup/dll/win32/shell32/classes.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
============================================================================== --- branches/shell32_new-bringup/dll/win32/shell32/classes.cpp [iso-8859-1] (original) +++ branches/shell32_new-bringup/dll/win32/shell32/classes.cpp [iso-8859-1] Wed Sep 7 23:21:02 2011 @@ -1,6 +1,6 @@ /* - * file type mapping - * (HKEY_CLASSES_ROOT - Stuff) + * file type mapping + * (HKEY_CLASSES_ROOT - Stuff) * * Copyright 1998, 1999, 2000 Juergen Schmied * @@ -27,76 +27,76 @@ BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot) { - HKEY hkey; - WCHAR szTemp[MAX_EXTENSION_LENGTH + 2]; - - TRACE("%s %p\n", debugstr_w(szExtension), debugstr_w(szFileType)); + HKEY hkey; + WCHAR szTemp[MAX_EXTENSION_LENGTH + 2]; + + TRACE("%s %p\n", debugstr_w(szExtension), debugstr_w(szFileType)); /* added because we do not want to have double dots */ if (szExtension[0] == '.') bPrependDot = 0; - if (bPrependDot) - szTemp[0] = '.'; - - lstrcpynW(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH); - - if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey)) - { - return FALSE; - } - - if (RegQueryValueW(hkey, NULL, szFileType, &len)) - { - RegCloseKey(hkey); - return FALSE; - } - - RegCloseKey(hkey); - - TRACE("--UE;\n} %s\n", debugstr_w(szFileType)); - - return TRUE; + if (bPrependDot) + szTemp[0] = '.'; + + lstrcpynW(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH); + + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey)) + { + return FALSE; + } + + if (RegQueryValueW(hkey, NULL, szFileType, &len)) + { + RegCloseKey(hkey); + return FALSE; + } + + RegCloseKey(hkey); + + TRACE("--UE;\n} %s\n", debugstr_w(szFileType)); + + return TRUE; } BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot) { - HKEY hkey; - char szTemp[MAX_EXTENSION_LENGTH + 2]; - - TRACE("%s %p\n", szExtension, szFileType); + HKEY hkey; + char szTemp[MAX_EXTENSION_LENGTH + 2]; + + TRACE("%s %p\n", szExtension, szFileType); /* added because we do not want to have double dots */ if (szExtension[0] == '.') bPrependDot = 0; - if (bPrependDot) - szTemp[0] = '.'; - - lstrcpynA(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH); - - if (RegOpenKeyExA(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey)) - { - return FALSE; - } - - if (RegLoadMUIStringA(hkey, "FriendlyTypeName", szFileType, len, NULL, 0, NULL) == ERROR_SUCCESS) - { - RegCloseKey(hkey); - return TRUE; - } - - if (RegQueryValueA(hkey, NULL, szFileType, &len)) - { - RegCloseKey(hkey); - return FALSE; - } - - RegCloseKey(hkey); - - TRACE("--UE;\n} %s\n", szFileType); - - return TRUE; + if (bPrependDot) + szTemp[0] = '.'; + + lstrcpynA(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH); + + if (RegOpenKeyExA(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey)) + { + return FALSE; + } + + if (RegLoadMUIStringA(hkey, "FriendlyTypeName", szFileType, len, NULL, 0, NULL) == ERROR_SUCCESS) + { + RegCloseKey(hkey); + return TRUE; + } + + if (RegQueryValueA(hkey, NULL, szFileType, &len)) + { + RegCloseKey(hkey); + return FALSE; + } + + RegCloseKey(hkey); + + TRACE("--UE;\n} %s\n", szFileType); + + return TRUE; } static const WCHAR swShell[] = {'s','h','e','l','l','\\',0}; @@ -164,12 +164,12 @@ BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len ) { - WCHAR sTempVerb[MAX_PATH]; - BOOL ret; - - TRACE("%p %s %s %p\n", hkeyClass, debugstr_w(szClass), debugstr_w(szVerb), szDest); - - if (szClass) + WCHAR sTempVerb[MAX_PATH]; + BOOL ret; + + TRACE("%p %s %s %p\n", hkeyClass, debugstr_w(szClass), debugstr_w(szVerb), szDest); + + if (szClass) RegOpenKeyExW(HKEY_CLASSES_ROOT, szClass, 0, KEY_READ, &hkeyClass); if (!hkeyClass) return FALSE; @@ -186,26 +186,26 @@ if (szClass) RegCloseKey(hkeyClass); - TRACE("-- %s\n", debugstr_w(szDest) ); - return ret; + TRACE("-- %s\n", debugstr_w(szDest) ); + return ret; } /*************************************************************************************** -* HCR_GetDefaultIcon [internal] +* HCR_GetDefaultIcon [internal] * * Gets the icon for a filetype */ static BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey) { - WCHAR xriid[50]; + WCHAR xriid[50]; swprintf( xriid, L"CLSID\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", riid.Data1, riid.Data2, riid.Data3, riid.Data4[0], riid.Data4[1], riid.Data4[2], riid.Data4[3], riid.Data4[4], riid.Data4[5], riid.Data4[6], riid.Data4[7] ); - TRACE("%S\n",xriid ); - - return !RegOpenKeyExW(HKEY_CLASSES_ROOT, xriid, 0, KEY_READ, hkey); + TRACE("%S\n",xriid ); + + return !RegOpenKeyExW(HKEY_CLASSES_ROOT, xriid, 0, KEY_READ, hkey); } static BOOL HCR_RegGetDefaultIconW(HKEY hkey, LPWSTR szDest, DWORD len, int* picon_idx) @@ -234,89 +234,89 @@ static BOOL HCR_RegGetDefaultIconA(HKEY hkey, LPSTR szDest, DWORD len, int* picon_idx) { - DWORD dwType; - char sTemp[MAX_PATH]; - char sNum[5]; - - if (!RegQueryValueExA(hkey, NULL, 0, &dwType, (LPBYTE)szDest, &len)) - { + DWORD dwType; + char sTemp[MAX_PATH]; + char sNum[5]; + + if (!RegQueryValueExA(hkey, NULL, 0, &dwType, (LPBYTE)szDest, &len)) + { if (dwType == REG_EXPAND_SZ) - { - ExpandEnvironmentStringsA(szDest, sTemp, MAX_PATH); - lstrcpynA(szDest, sTemp, len); - } - if (ParseFieldA (szDest, 2, sNum, 5)) + { + ExpandEnvironmentStringsA(szDest, sTemp, MAX_PATH); + lstrcpynA(szDest, sTemp, len); + } + if (ParseFieldA (szDest, 2, sNum, 5)) *picon_idx=atoi(sNum); else *picon_idx=0; /* sometimes the icon number is missing */ - ParseFieldA (szDest, 1, szDest, len); + ParseFieldA (szDest, 1, szDest, len); PathUnquoteSpacesA(szDest); - return TRUE; - } - return FALSE; + return TRUE; + } + return FALSE; } BOOL HCR_GetDefaultIconW(LPCWSTR szClass, LPWSTR szDest, DWORD len, int* picon_idx) { static const WCHAR swDefaultIcon[] = {'\\','D','e','f','a','u','l','t','I','c','o','n',0}; - HKEY hkey; - WCHAR sTemp[MAX_PATH]; - BOOL ret = FALSE; - - TRACE("%s\n",debugstr_w(szClass) ); - - lstrcpynW(sTemp, szClass, MAX_PATH); - wcscat(sTemp, swDefaultIcon); - - if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey)) - { - ret = HCR_RegGetDefaultIconW(hkey, szDest, len, picon_idx); - RegCloseKey(hkey); - } + HKEY hkey; + WCHAR sTemp[MAX_PATH]; + BOOL ret = FALSE; + + TRACE("%s\n",debugstr_w(szClass) ); + + lstrcpynW(sTemp, szClass, MAX_PATH); + wcscat(sTemp, swDefaultIcon); + + if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey)) + { + ret = HCR_RegGetDefaultIconW(hkey, szDest, len, picon_idx); + RegCloseKey(hkey); + } if(ret) TRACE("-- %s %i\n", debugstr_w(szDest), *picon_idx); else TRACE("-- not found\n"); - return ret; + return ret; } BOOL HCR_GetDefaultIconA(LPCSTR szClass, LPSTR szDest, DWORD len, int* picon_idx) { - HKEY hkey; - char sTemp[MAX_PATH]; - BOOL ret = FALSE; - - TRACE("%s\n",szClass ); - - sprintf(sTemp, "%s\\DefaultIcon",szClass); - - if (!RegOpenKeyExA(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey)) - { - ret = HCR_RegGetDefaultIconA(hkey, szDest, len, picon_idx); - RegCloseKey(hkey); - } - TRACE("-- %s %i\n", szDest, *picon_idx); - return ret; + HKEY hkey; + char sTemp[MAX_PATH]; + BOOL ret = FALSE; + + TRACE("%s\n",szClass ); + + sprintf(sTemp, "%s\\DefaultIcon",szClass); + + if (!RegOpenKeyExA(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey)) + { + ret = HCR_RegGetDefaultIconA(hkey, szDest, len, picon_idx); + RegCloseKey(hkey); + } + TRACE("-- %s %i\n", szDest, *picon_idx); + return ret; } BOOL HCR_GetDefaultIconFromGUIDW(REFIID riid, LPWSTR szDest, DWORD len, int* picon_idx) { - HKEY hkey; - BOOL ret = FALSE; - - if (HCR_RegOpenClassIDKey(riid, &hkey)) - { - ret = HCR_RegGetDefaultIconW(hkey, szDest, len, picon_idx); - RegCloseKey(hkey); - } - TRACE("-- %s %i\n", debugstr_w(szDest), *picon_idx); - return ret; + HKEY hkey; + BOOL ret = FALSE; + + if (HCR_RegOpenClassIDKey(riid, &hkey)) + { + ret = HCR_RegGetDefaultIconW(hkey, szDest, len, picon_idx); + RegCloseKey(hkey); + } + TRACE("-- %s %i\n", debugstr_w(szDest), *picon_idx); + return ret; } /*************************************************************************************** -* HCR_GetClassName [internal] +* HCR_GetClassName [internal] * * Gets the name of a registered class */ @@ -324,107 +324,107 @@ BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len) { - HKEY hkey; - BOOL ret = FALSE; - DWORD buflen = len; - WCHAR szName[100]; - LPOLESTR pStr; - - szDest[0] = 0; - - if (StringFromCLSID(riid, &pStr) == S_OK) - { - DWORD dwLen = buflen * sizeof(WCHAR); - swprintf(szName, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s", pStr); - if (RegGetValueW(HKEY_CURRENT_USER, szName, NULL, RRF_RT_REG_SZ, NULL, (PVOID)szDest, &dwLen) == ERROR_SUCCESS) - { - ret = TRUE; - } - CoTaskMemFree(pStr); - } - if (!ret && HCR_RegOpenClassIDKey(riid, &hkey)) - { + HKEY hkey; + BOOL ret = FALSE; + DWORD buflen = len; + WCHAR szName[100]; + LPOLESTR pStr; + + szDest[0] = 0; + + if (StringFromCLSID(riid, &pStr) == S_OK) + { + DWORD dwLen = buflen * sizeof(WCHAR); + swprintf(szName, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s", pStr); + if (RegGetValueW(HKEY_CURRENT_USER, szName, NULL, RRF_RT_REG_SZ, NULL, (PVOID)szDest, &dwLen) == ERROR_SUCCESS) + { + ret = TRUE; + } + CoTaskMemFree(pStr); + } + if (!ret && HCR_RegOpenClassIDKey(riid, &hkey)) + { 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)) { - ret = TRUE; - } - RegCloseKey(hkey); - } - - if (!ret || !szDest[0]) - { - if(IsEqualIID(riid, CLSID_ShellDesktop)) - { - if (LoadStringW(shell32_hInstance, IDS_DESKTOP, szDest, buflen)) - ret = TRUE; - } - else if (IsEqualIID(riid, CLSID_MyComputer)) - { - if(LoadStringW(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen)) - ret = TRUE; - } - else if (IsEqualIID(riid, CLSID_MyDocuments)) - { - if(LoadStringW(shell32_hInstance, IDS_PERSONAL, szDest, buflen)) - ret = TRUE; - } - else if (IsEqualIID(riid, CLSID_RecycleBin)) - { - if(LoadStringW(shell32_hInstance, IDS_RECYCLEBIN_FOLDER_NAME, szDest, buflen)) - ret = TRUE; - } - else if (IsEqualIID(riid, CLSID_ControlPanel)) - { - if(LoadStringW(shell32_hInstance, IDS_CONTROLPANEL, szDest, buflen)) - ret = TRUE; - } - else if (IsEqualIID(riid, CLSID_AdminFolderShortcut)) - { - if(LoadStringW(shell32_hInstance, IDS_ADMINISTRATIVETOOLS, szDest, buflen)) - ret = TRUE; - } - - } - TRACE("-- %s\n", debugstr_w(szDest)); - return ret; + ret = TRUE; + } + RegCloseKey(hkey); + } + + if (!ret || !szDest[0]) + { + if(IsEqualIID(riid, CLSID_ShellDesktop)) + { + if (LoadStringW(shell32_hInstance, IDS_DESKTOP, szDest, buflen)) + ret = TRUE; + } + else if (IsEqualIID(riid, CLSID_MyComputer)) + { + if(LoadStringW(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen)) + ret = TRUE; + } + else if (IsEqualIID(riid, CLSID_MyDocuments)) + { + if(LoadStringW(shell32_hInstance, IDS_PERSONAL, szDest, buflen)) + ret = TRUE; + } + else if (IsEqualIID(riid, CLSID_RecycleBin)) + { + if(LoadStringW(shell32_hInstance, IDS_RECYCLEBIN_FOLDER_NAME, szDest, buflen)) + ret = TRUE; + } + else if (IsEqualIID(riid, CLSID_ControlPanel)) + { + if(LoadStringW(shell32_hInstance, IDS_CONTROLPANEL, szDest, buflen)) + ret = TRUE; + } + else if (IsEqualIID(riid, CLSID_AdminFolderShortcut)) + { + if(LoadStringW(shell32_hInstance, IDS_ADMINISTRATIVETOOLS, szDest, buflen)) + ret = TRUE; + } + + } + TRACE("-- %s\n", debugstr_w(szDest)); + return ret; } BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len) -{ HKEY hkey; - BOOL ret = FALSE; - DWORD buflen = len; - - szDest[0] = 0; - if (HCR_RegOpenClassIDKey(riid, &hkey)) - { +{ HKEY hkey; + BOOL ret = FALSE; + DWORD buflen = len; + + szDest[0] = 0; + if (HCR_RegOpenClassIDKey(riid, &hkey)) + { if (!RegLoadMUIStringA(hkey,"LocalizedString",szDest,len,NULL,0,NULL) || !RegQueryValueExA(hkey,"",0,NULL,(LPBYTE)szDest,&len)) { - ret = TRUE; - } - RegCloseKey(hkey); - } - - if (!ret || !szDest[0]) - { - if(IsEqualIID(riid, CLSID_ShellDesktop)) - { - if (LoadStringA(shell32_hInstance, IDS_DESKTOP, szDest, buflen)) - ret = TRUE; - } - else if (IsEqualIID(riid, CLSID_MyComputer)) - { - if(LoadStringA(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen)) - ret = TRUE; - } - } - - TRACE("-- %s\n", szDest); - - return ret; + ret = TRUE; + } + RegCloseKey(hkey); + } + + if (!ret || !szDest[0]) + { + if(IsEqualIID(riid, CLSID_ShellDesktop)) + { + if (LoadStringA(shell32_hInstance, IDS_DESKTOP, szDest, buflen)) + ret = TRUE; + } + else if (IsEqualIID(riid, CLSID_MyComputer)) + { + if(LoadStringA(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen)) + ret = TRUE; + } + } + + TRACE("-- %s\n", szDest); + + return ret; } /****************************************************************************** @@ -476,8 +476,8 @@ dwLen = sizeof(DWORD); lResult = RegQueryValueExW(hSFKey, wszCallForAttributes, 0, NULL, (LPBYTE)&dwTemp, &dwLen); if ((lResult == ERROR_SUCCESS) && (dwTemp & *pdwAttributes)) { - CComPtr<IShellFolder> psfDesktop; - CComPtr<IShellFolder> psfFolder; + CComPtr<IShellFolder> psfDesktop; + CComPtr<IShellFolder> psfFolder; HRESULT hr; RegCloseKey(hSFKey); Modified: branches/shell32_new-bringup/dll/win32/shell32/debughlp.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
============================================================================== --- branches/shell32_new-bringup/dll/win32/shell32/debughlp.cpp [iso-8859-1] (original) +++ branches/shell32_new-bringup/dll/win32/shell32/debughlp.cpp [iso-8859-1] Wed Sep 7 23:21:02 2011 @@ -25,221 +25,221 @@ static LPITEMIDLIST _dbg_ILGetNext(LPCITEMIDLIST pidl) { - WORD len; - - if(pidl) - { - len = pidl->mkid.cb; - if (len) - { - return (LPITEMIDLIST) (((LPBYTE)pidl)+len); - } - } - return NULL; + WORD len; + + if(pidl) + { + len = pidl->mkid.cb; + if (len) + { + return (LPITEMIDLIST) (((LPBYTE)pidl)+len); + } + } + return NULL; } static BOOL _dbg_ILIsDesktop(LPCITEMIDLIST pidl) { - return ( !pidl || (pidl && pidl->mkid.cb == 0x00) ); + return ( !pidl || (pidl && pidl->mkid.cb == 0x00) ); } static LPPIDLDATA _dbg_ILGetDataPointer(LPCITEMIDLIST pidl) { - if(pidl && pidl->mkid.cb != 0x00) - return (LPPIDLDATA) &(pidl->mkid.abID); - return NULL; + if(pidl && pidl->mkid.cb != 0x00) + return (LPPIDLDATA) &(pidl->mkid.abID); + return NULL; } static LPSTR _dbg_ILGetTextPointer(LPCITEMIDLIST pidl) { - LPPIDLDATA pdata =_dbg_ILGetDataPointer(pidl); - - if (pdata) - { - switch (pdata->type) - { - case PT_GUID: - case PT_SHELLEXT: - case PT_YAGUID: - return NULL; - - case PT_DRIVE: - case PT_DRIVE1: - case PT_DRIVE2: - case PT_DRIVE3: - return (LPSTR)&(pdata->u.drive.szDriveName); - - case PT_FOLDER: - case PT_FOLDER1: - case PT_VALUE: - case PT_IESPECIAL1: - case PT_IESPECIAL2: - return (LPSTR)&(pdata->u.file.szNames); - - case PT_WORKGRP: - case PT_COMP: - case PT_NETWORK: - case PT_NETPROVIDER: - case PT_SHARE: - return (LPSTR)&(pdata->u.network.szNames); - } - } - return NULL; + LPPIDLDATA pdata =_dbg_ILGetDataPointer(pidl); + + if (pdata) + { + switch (pdata->type) + { + case PT_GUID: + case PT_SHELLEXT: + case PT_YAGUID: + return NULL; + + case PT_DRIVE: + case PT_DRIVE1: + case PT_DRIVE2: + case PT_DRIVE3: + return (LPSTR)&(pdata->u.drive.szDriveName); + + case PT_FOLDER: + case PT_FOLDER1: + case PT_VALUE: + case PT_IESPECIAL1: + case PT_IESPECIAL2: + return (LPSTR)&(pdata->u.file.szNames); + + case PT_WORKGRP: + case PT_COMP: + case PT_NETWORK: + case PT_NETPROVIDER: + case PT_SHARE: + return (LPSTR)&(pdata->u.network.szNames); + } + } + return NULL; } static LPWSTR _dbg_ILGetTextPointerW(LPCITEMIDLIST pidl) { - LPPIDLDATA pdata =_dbg_ILGetDataPointer(pidl); - - if (pdata) - { - switch (pdata->type) - { - case PT_GUID: - case PT_SHELLEXT: - case PT_YAGUID: - return NULL; - - case PT_DRIVE: - case PT_DRIVE1: - case PT_DRIVE2: - case PT_DRIVE3: - /* return (LPSTR)&(pdata->u.drive.szDriveName);*/ - return NULL; - - case PT_FOLDER: - case PT_FOLDER1: - case PT_VALUE: - case PT_IESPECIAL1: - case PT_IESPECIAL2: - /* return (LPSTR)&(pdata->u.file.szNames); */ - return NULL; - - case PT_WORKGRP: - case PT_COMP: - case PT_NETWORK: - case PT_NETPROVIDER: - case PT_SHARE: - /* return (LPSTR)&(pdata->u.network.szNames); */ - return NULL; - - case PT_VALUEW: - return (LPWSTR)&(pdata->u.file.szNames); - } - } - return NULL; + LPPIDLDATA pdata =_dbg_ILGetDataPointer(pidl); + + if (pdata) + { + switch (pdata->type) + { + case PT_GUID: + case PT_SHELLEXT: + case PT_YAGUID: + return NULL; + + case PT_DRIVE: + case PT_DRIVE1: + case PT_DRIVE2: + case PT_DRIVE3: + /* return (LPSTR)&(pdata->u.drive.szDriveName);*/ + return NULL; + + case PT_FOLDER: + case PT_FOLDER1: + case PT_VALUE: + case PT_IESPECIAL1: + case PT_IESPECIAL2: + /* return (LPSTR)&(pdata->u.file.szNames); */ + return NULL; + + case PT_WORKGRP: + case PT_COMP: + case PT_NETWORK: + case PT_NETPROVIDER: + case PT_SHARE: + /* return (LPSTR)&(pdata->u.network.szNames); */ + return NULL; + + case PT_VALUEW: + return (LPWSTR)&(pdata->u.file.szNames); + } + } + return NULL; } static LPSTR _dbg_ILGetSTextPointer(LPCITEMIDLIST pidl) { - LPPIDLDATA pdata =_dbg_ILGetDataPointer(pidl); - - if (pdata) - { - switch (pdata->type) - { - case PT_FOLDER: - case PT_VALUE: - case PT_IESPECIAL1: - case PT_IESPECIAL2: - return (LPSTR)(pdata->u.file.szNames + strlen (pdata->u.file.szNames) + 1); - - case PT_WORKGRP: - return (LPSTR)(pdata->u.network.szNames + strlen (pdata->u.network.szNames) + 1); - } - } - return NULL; + LPPIDLDATA pdata =_dbg_ILGetDataPointer(pidl); + + if (pdata) + { + switch (pdata->type) + { + case PT_FOLDER: + case PT_VALUE: + case PT_IESPECIAL1: + case PT_IESPECIAL2: + return (LPSTR)(pdata->u.file.szNames + strlen (pdata->u.file.szNames) + 1); + + case PT_WORKGRP: + return (LPSTR)(pdata->u.network.szNames + strlen (pdata->u.network.szNames) + 1); + } + } + return NULL; } static LPWSTR _dbg_ILGetSTextPointerW(LPCITEMIDLIST pidl) { - LPPIDLDATA pdata =_dbg_ILGetDataPointer(pidl); - - if (pdata) - { - switch (pdata->type) - { - case PT_FOLDER: - case PT_VALUE: - case PT_IESPECIAL1: - case PT_IESPECIAL2: - /*return (LPSTR)(pdata->u.file.szNames + strlen (pdata->u.file.szNames) + 1); */ - return NULL; - - case PT_WORKGRP: - /* return (LPSTR)(pdata->u.network.szNames + strlen (pdata->u.network.szNames) + 1); */ - return NULL; - - case PT_VALUEW: - return (LPWSTR)(pdata->u.file.szNames + wcslen ((LPWSTR)pdata->u.file.szNames) + 1); - } - } - return NULL; + LPPIDLDATA pdata =_dbg_ILGetDataPointer(pidl); + + if (pdata) + { + switch (pdata->type) + { + case PT_FOLDER: + case PT_VALUE: + case PT_IESPECIAL1: + case PT_IESPECIAL2: + /*return (LPSTR)(pdata->u.file.szNames + strlen (pdata->u.file.szNames) + 1); */ + return NULL; + + case PT_WORKGRP: + /* return (LPSTR)(pdata->u.network.szNames + strlen (pdata->u.network.szNames) + 1); */ + return NULL; + + case PT_VALUEW: + return (LPWSTR)(pdata->u.file.szNames + wcslen ((LPWSTR)pdata->u.file.szNames) + 1); + } + } + return NULL; } static IID* _dbg_ILGetGUIDPointer(LPCITEMIDLIST pidl) { - LPPIDLDATA pdata =_ILGetDataPointer(pidl); - - if (pdata) - { - switch (pdata->type) - { - case PT_SHELLEXT: - case PT_GUID: + LPPIDLDATA pdata =_ILGetDataPointer(pidl); + + if (pdata) + { + switch (pdata->type) + { + case PT_SHELLEXT: + case PT_GUID: case PT_YAGUID: - return &(pdata->u.guid.guid); - } - } - return NULL; + return &(pdata->u.guid.guid); + } + } + return NULL; } static void _dbg_ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize) { - LPSTR szSrc; - LPWSTR szSrcW; - GUID const * riid; - - if (!pidl) return; - - if (szOut) - *szOut = 0; - - if (_dbg_ILIsDesktop(pidl)) - { - /* desktop */ - if (szOut) lstrcpynA(szOut, "Desktop", uOutSize); - } - else if (( szSrc = _dbg_ILGetTextPointer(pidl) )) - { - /* filesystem */ - if (szOut) lstrcpynA(szOut, szSrc, uOutSize); - } - else if (( szSrcW = _dbg_ILGetTextPointerW(pidl) )) - { - CHAR tmp[MAX_PATH]; - /* unicode filesystem */ - WideCharToMultiByte(CP_ACP,0,szSrcW, -1, tmp, MAX_PATH, NULL, NULL); - if (szOut) lstrcpynA(szOut, tmp, uOutSize); - } - else if (( riid = _dbg_ILGetGUIDPointer(pidl) )) - { - if (szOut) + LPSTR szSrc; + LPWSTR szSrcW; + GUID const * riid; + + if (!pidl) return; + + if (szOut) + *szOut = 0; + + if (_dbg_ILIsDesktop(pidl)) + { + /* desktop */ + if (szOut) lstrcpynA(szOut, "Desktop", uOutSize); + } + else if (( szSrc = _dbg_ILGetTextPointer(pidl) )) + { + /* filesystem */ + if (szOut) lstrcpynA(szOut, szSrc, uOutSize); + } + else if (( szSrcW = _dbg_ILGetTextPointerW(pidl) )) + { + CHAR tmp[MAX_PATH]; + /* unicode filesystem */ + WideCharToMultiByte(CP_ACP,0,szSrcW, -1, tmp, MAX_PATH, NULL, NULL); + if (szOut) lstrcpynA(szOut, tmp, uOutSize); + } + else if (( riid = _dbg_ILGetGUIDPointer(pidl) )) + { + if (szOut) sprintf( szOut, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", riid->Data1, riid->Data2, riid->Data3, riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] ); - } + } } @@ -247,21 +247,21 @@ void pdump (LPCITEMIDLIST pidl) { - LPCITEMIDLIST pidltemp = pidl; - - if (!TRACE_ON(pidl)) return; - - if (! pidltemp) - { - MESSAGE ("-------- pidl=NULL (Desktop)\n"); - } - else - { - MESSAGE ("-------- pidl=%p\n", pidl); - if (pidltemp->mkid.cb) - { - do - { + LPCITEMIDLIST pidltemp = pidl; + + if (!TRACE_ON(pidl)) return; + + if (! pidltemp) + { + MESSAGE ("-------- pidl=NULL (Desktop)\n"); + } + else + { + MESSAGE ("-------- pidl=%p\n", pidl); + if (pidltemp->mkid.cb) + { + do + { if (_ILIsUnicode(pidltemp)) { DWORD dwAttrib = 0; @@ -297,16 +297,16 @@ debugstr_a(szName), debugstr_a(szLongName), debugstr_a(szShortName)); } - pidltemp = _dbg_ILGetNext(pidltemp); - - } while (pidltemp && pidltemp->mkid.cb); - } - else - { - MESSAGE ("empty pidl (Desktop)\n"); - } - pcheck(pidl); - } + pidltemp = _dbg_ILGetNext(pidltemp); + + } while (pidltemp && pidltemp->mkid.cb); + } + else + { + MESSAGE ("empty pidl (Desktop)\n"); + } + pcheck(pidl); + } } static void dump_pidl_hex( LPCITEMIDLIST pidl ) @@ -340,83 +340,92 @@ while( pidltemp && pidltemp->mkid.cb ) { - type = _dbg_ILGetDataPointer(pidltemp)->type; - switch( type ) + LPPIDLDATA pidlData = _dbg_ILGetDataPointer(pidltemp); + + if (pidlData) { - case PT_CPLAPPLET: - case PT_GUID: - case PT_SHELLEXT: - case PT_DRIVE: - case PT_DRIVE1: - case PT_DRIVE2: - case PT_DRIVE3: - case PT_FOLDER: - case PT_VALUE: - case PT_VALUEW: - case PT_FOLDER1: - case PT_WORKGRP: - case PT_COMP: - case PT_NETPROVIDER: - case PT_NETWORK: - case PT_IESPECIAL1: - case PT_YAGUID: - case PT_IESPECIAL2: - case PT_SHARE: - break; - default: - ERR("unknown IDLIST %p [%p] size=%u type=%x\n", - pidl, pidltemp, pidltemp->mkid.cb,type ); - dump_pidl_hex( pidltemp ); + type = pidlData->type; + switch( type ) + { + case PT_CPLAPPLET: + case PT_GUID: + case PT_SHELLEXT: + case PT_DRIVE: + case PT_DRIVE1: + case PT_DRIVE2: + case PT_DRIVE3: + case PT_FOLDER: + case PT_VALUE: + case PT_VALUEW: + case PT_FOLDER1: + case PT_WORKGRP: + case PT_COMP: + case PT_NETPROVIDER: + case PT_NETWORK: + case PT_IESPECIAL1: + case PT_YAGUID: + case PT_IESPECIAL2: + case PT_SHARE: + break; + default: + ERR("unknown IDLIST %p [%p] size=%u type=%x\n", + pidl, pidltemp, pidltemp->mkid.cb,type ); + dump_pidl_hex( pidltemp ); + return FALSE; + } + pidltemp = _dbg_ILGetNext(pidltemp); + } + else + { return FALSE; } - pidltemp = _dbg_ILGetNext(pidltemp); } return TRUE; } static const struct { - REFIID riid; - const char *name; + REFIID riid; + const char *name; } InterfaceDesc[] = { - {IID_IUnknown, "IID_IUnknown"}, - {IID_IClassFactory, "IID_IClassFactory"}, - {IID_IShellView, "IID_IShellView"}, - {IID_IOleCommandTarget, "IID_IOleCommandTarget"}, - {IID_IDropTarget, "IID_IDropTarget"}, - {IID_IDropSource, "IID_IDropSource"}, - {IID_IViewObject, "IID_IViewObject"}, - {IID_IContextMenu, "IID_IContextMenu"}, - {IID_IShellExtInit, "IID_IShellExtInit"}, - {IID_IShellFolder, "IID_IShellFolder"}, - {IID_IShellFolder2, "IID_IShellFolder2"}, - {IID_IPersist, "IID_IPersist"}, - {IID_IPersistFolder, "IID_IPersistFolder"}, - {IID_IPersistFolder2, "IID_IPersistFolder2"}, - {IID_IPersistFolder3, "IID_IPersistFolder3"}, - {IID_IExtractIconA, "IID_IExtractIconA"}, - {IID_IExtractIconW, "IID_IExtractIconW"}, - {IID_IDataObject, "IID_IDataObject"}, - {IID_IAutoComplete, "IID_IAutoComplete"}, - {IID_IAutoComplete2, "IID_IAutoComplete2"}, + {IID_IUnknown, "IID_IUnknown"}, + {IID_IClassFactory, "IID_IClassFactory"}, + {IID_IShellView, "IID_IShellView"}, + {IID_IOleCommandTarget, "IID_IOleCommandTarget"}, + {IID_IDropTarget, "IID_IDropTarget"}, + {IID_IDropSource, "IID_IDropSource"}, + {IID_IViewObject, "IID_IViewObject"}, + {IID_IContextMenu, "IID_IContextMenu"}, + {IID_IShellExtInit, "IID_IShellExtInit"}, + {IID_IShellFolder, "IID_IShellFolder"}, + {IID_IShellFolder2, "IID_IShellFolder2"}, + {IID_IPersist, "IID_IPersist"}, + {IID_IPersistFolder, "IID_IPersistFolder"}, + {IID_IPersistFolder2, "IID_IPersistFolder2"}, + {IID_IPersistFolder3, "IID_IPersistFolder3"}, + {IID_IExtractIconA, "IID_IExtractIconA"}, + {IID_IExtractIconW, "IID_IExtractIconW"}, + {IID_IDataObject, "IID_IDataObject"}, + {IID_IAutoComplete, "IID_IAutoComplete"}, + {IID_IAutoComplete2, "IID_IAutoComplete2"}, {IID_IShellLinkA, "IID_IShellLinkA"}, {IID_IShellLinkW, "IID_IShellLinkW"}, - }; + }; const char * shdebugstr_guid( const struct _GUID *id ) { - unsigned int i; - const char* name = NULL; - char clsidbuf[100]; - - if (!id) return "(null)"; - - for (i=0; i < sizeof(InterfaceDesc) / sizeof(InterfaceDesc[0]); i++) { - if (IsEqualIID(InterfaceDesc[i].riid, *id)) name = InterfaceDesc[i].name; - } - if (!name) { - if (HCR_GetClassNameA(*id, clsidbuf, 100)) - name = clsidbuf; - } + unsigned int i; + const char* name = NULL; + char clsidbuf[100]; + + if (!id) return "(null)"; + + for (i=0; i < sizeof(InterfaceDesc) / sizeof(InterfaceDesc[0]); i++) { + if (IsEqualIID(InterfaceDesc[i].riid, *id)) name = InterfaceDesc[i].name; + } + if (!name) { + if (HCR_GetClassNameA(*id, clsidbuf, 100)) + name = clsidbuf; + } return wine_dbg_sprintf( "\n\t{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x} (%s)", id->Data1, id->Data2, id->Data3, Modified: branches/shell32_new-bringup/dll/win32/shell32/dialogs.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
============================================================================== --- branches/shell32_new-bringup/dll/win32/shell32/dialogs.cpp [iso-8859-1] (original) +++ branches/shell32_new-bringup/dll/win32/shell32/dialogs.cpp [iso-8859-1] Wed Sep 7 23:21:02 2011 @@ -1,5 +1,5 @@ /* - * common shell dialogs + * common shell dialogs * * Copyright 2000 Juergen Schmied * @@ -22,14 +22,14 @@ typedef struct - { - HWND hwndOwner ; - HICON hIcon ; - LPCWSTR lpstrDirectory ; - LPCWSTR lpstrTitle ; - LPCWSTR lpstrDescription ; - UINT uFlags ; - } RUNFILEDLGPARAMS ; +{ + HWND hwndOwner ; + HICON hIcon ; + LPCWSTR lpstrDirectory ; + LPCWSTR lpstrTitle ; + LPCWSTR lpstrDescription ; + UINT uFlags ; +} RUNFILEDLGPARAMS ; typedef BOOL (WINAPI * LPFNOFN) (OPENFILENAMEW *) ; @@ -39,7 +39,7 @@ /************************************************************************* - * PickIconDlg [SHELL32.62] + * PickIconDlg [SHELL32.62] * */ @@ -261,17 +261,17 @@ } /************************************************************************* - * RunFileDlg [internal] + * RunFileDlg [internal] * * The Unicode function that is available as ordinal 61 on Windows NT/2000/XP/... */ void WINAPI RunFileDlg( - HWND hwndOwner, - HICON hIcon, - LPCWSTR lpstrDirectory, - LPCWSTR lpstrTitle, - LPCWSTR lpstrDescription, - UINT uFlags) + HWND hwndOwner, + HICON hIcon, + LPCWSTR lpstrDirectory, + LPCWSTR lpstrTitle, + LPCWSTR lpstrDescription, + UINT uFlags) { static const WCHAR resnameW[] = {'S','H','E','L','L','_','R','U','N','_','D','L','G',0}; RUNFILEDLGPARAMS rfdp; @@ -295,7 +295,7 @@ } DialogBoxIndirectParamW(shell32_hInstance, - (LPCDLGTEMPLATEW)tmplate, hwndOwner, RunDlgProc, (LPARAM)&rfdp); + (LPCDLGTEMPLATEW)tmplate, hwndOwner, RunDlgProc, (LPARAM)&rfdp); } @@ -308,6 +308,12 @@ static const WCHAR dotexeW[] = {'.','e','x','e',0}; result = (WCHAR *)HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*(strlenW(cmdline)+5)); + + if (NULL == result) + { + TRACE("HeapAlloc couldn't allocate %d bytes\n", sizeof(WCHAR)*(strlenW(cmdline)+5)); + return NULL; + } src = cmdline; dest = result; @@ -391,50 +397,54 @@ case WM_COMMAND : switch (LOWORD (wParam)) + { + case IDOK : { - case IDOK : - { int ic ; HWND htxt = GetDlgItem (hwnd, IDC_RUNDLG_EDITPATH); if ((ic = GetWindowTextLengthW (htxt))) - { + { WCHAR *psz, *parent=NULL ; SHELLEXECUTEINFOW sei ; ZeroMemory (&sei, sizeof(sei)) ; sei.cbSize = sizeof(sei) ; psz = (WCHAR *)HeapAlloc( GetProcessHeap(), 0, (ic + 1)*sizeof(WCHAR) ); - GetWindowTextW (htxt, psz, ic + 1) ; - - /* according to
http://www.codeproject.com/KB/shell/runfiledlg.aspx
we should send a - * WM_NOTIFY before execution */ - - sei.hwnd = hwnd; - sei.nShow = SW_SHOWNORMAL; - sei.lpFile = psz; - - if (prfdp->lpstrDirectory) - sei.lpDirectory = prfdp->lpstrDirectory; - else - sei.lpDirectory = parent = RunDlg_GetParentDir(sei.lpFile); - - if (!ShellExecuteExW( &sei )) + + if (psz) { + GetWindowTextW (htxt, psz, ic + 1) ; + + /* according to
http://www.codeproject.com/KB/shell/runfiledlg.aspx
we should send a + * WM_NOTIFY before execution */ + + sei.hwnd = hwnd; + sei.nShow = SW_SHOWNORMAL; + sei.lpFile = psz; + + if (prfdp->lpstrDirectory) + sei.lpDirectory = prfdp->lpstrDirectory; + else + sei.lpDirectory = parent = RunDlg_GetParentDir(sei.lpFile); + + if (!ShellExecuteExW( &sei )) + { + HeapFree(GetProcessHeap(), 0, psz); + HeapFree(GetProcessHeap(), 0, parent); + SendMessageA (htxt, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ; + return TRUE ; + } + + /* FillList is still ANSI */ + GetWindowTextA (htxt, (LPSTR)psz, ic + 1) ; + FillList (htxt, (LPSTR)psz, FALSE) ; + HeapFree(GetProcessHeap(), 0, psz); HeapFree(GetProcessHeap(), 0, parent); - SendMessageA (htxt, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ; - return TRUE ; - } - - /* FillList is still ANSI */ - GetWindowTextA (htxt, (LPSTR)psz, ic + 1) ; - FillList (htxt, (LPSTR)psz, FALSE) ; - - HeapFree(GetProcessHeap(), 0, psz); - HeapFree(GetProcessHeap(), 0, parent); - EndDialog (hwnd, 0); + EndDialog (hwnd, 0); } } + } case IDCANCEL : EndDialog (hwnd, 0) ; @@ -491,7 +501,7 @@ /* This grabs the MRU list from the registry and fills the combo for the "Run" dialog above */ /* fShowDefault ignored if pszLatest != NULL */ static void FillList (HWND hCb, char *pszLatest, BOOL fShowDefault) - { +{ HKEY hkey ; /* char szDbgMsg[256] = "" ; */ char *pszList = NULL, *pszCmd = NULL, cMatch = 0, cMax = 0x60, szIndex[2] = "-" ; @@ -508,20 +518,28 @@ RegQueryValueExA (hkey, "MRUList", NULL, NULL, NULL, &icList) ; if (icList > 0) - { + { pszList = (char *)HeapAlloc( GetProcessHeap(), 0, icList) ; - if (ERROR_SUCCESS != RegQueryValueExA (hkey, "MRUList", NULL, NULL, (LPBYTE)pszList, &icList)) - MessageBoxA (hCb, "Unable to grab MRUList !", "Nix", MB_OK) ; - } + + if (pszList) + { + if (ERROR_SUCCESS != RegQueryValueExA (hkey, "MRUList", NULL, NULL, (LPBYTE)pszList, &icList)) + MessageBoxA (hCb, "Unable to grab MRUList !", "Nix", MB_OK); + } + else + { + TRACE("HeapAlloc failed to allocate %d bytes\n", icList); + } + } else - { + { icList = 1 ; pszList = (char *)HeapAlloc( GetProcessHeap(), 0, icList) ; pszList[0] = 0 ; - } + } for (Nix = 0 ; Nix < icList - 1 ; Nix++) - { + { if (pszList[Nix] > cMax) cMax = pszList[Nix] ; @@ -537,9 +555,9 @@ MessageBoxA (hCb, "Unable to grab index", "Nix", MB_OK) ; if (NULL != pszLatest) + { + if (!lstrcmpiA(pszCmd, pszLatest)) { - if (!lstrcmpiA(pszCmd, pszLatest)) - { /* sprintf (szDbgMsg, "Found existing (%d).\n", Nix) ; MessageBoxA (hCb, szDbgMsg, "Nix", MB_OK) ; @@ -552,25 +570,24 @@ memmove (&pszList[1], pszList, Nix) ; pszList[0] = cMatch ; continue ; - } } + } if (26 != icList - 1 || icList - 2 != Nix || cMatch || NULL == pszLatest) - { + { /* sprintf (szDbgMsg, "Happily appending (%d).\n", Nix) ; MessageBoxA (hCb, szDbgMsg, "Nix", MB_OK) ; */ SendMessageA (hCb, CB_ADDSTRING, 0, (LPARAM)pszCmd) ; if (!Nix && fShowDefault) - { + { SetWindowTextA (hCb, pszCmd) ; SendMessageA (hCb, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ; - } - } + } else - { + { /* sprintf (szDbgMsg, "Doing loop thing.\n") ; MessageBoxA (hCb, szDbgMsg, "Nix", MB_OK) ; @@ -584,11 +601,11 @@ pszList[0] = cMatch ; szIndex[0] = cMatch ; RegSetValueExA (hkey, szIndex, 0, REG_SZ, (LPBYTE)pszLatest, strlen (pszLatest) + 1) ; - } - } + } + } if (!cMatch && NULL != pszLatest) - { + { /* sprintf (szDbgMsg, "Simply inserting (increasing list).\n") ; MessageBoxA (hCb, szDbgMsg, "Nix", MB_OK) ; @@ -598,25 +615,33 @@ SendMessageA (hCb, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ; cMatch = ++cMax ; - if( pszList ) + if (pszList) pszList = (char *)HeapReAlloc(GetProcessHeap(), 0, pszList, ++icList) ; else pszList = (char *)HeapAlloc(GetProcessHeap(), 0, ++icList) ; - memmove (&pszList[1], pszList, icList - 1) ; - pszList[0] = cMatch ; - szIndex[0] = cMatch ; - RegSetValueExA (hkey, szIndex, 0, REG_SZ, (LPBYTE)pszLatest, strlen (pszLatest) + 1) ; - } + + if (pszList) + { + memmove (&pszList[1], pszList, icList - 1) ; + pszList[0] = cMatch ; + szIndex[0] = cMatch ; + RegSetValueExA (hkey, szIndex, 0, REG_SZ, (LPBYTE)pszLatest, strlen (pszLatest) + 1) ; + } + else + { + TRACE("HeapAlloc or HeapReAlloc failed to allocate enough bytes\n"); + } + } RegSetValueExA (hkey, "MRUList", 0, REG_SZ, (LPBYTE)pszList, strlen (pszList) + 1) ; HeapFree( GetProcessHeap(), 0, pszCmd) ; HeapFree( GetProcessHeap(), 0, pszList) ; - } +} /************************************************************************* - * ConfirmDialog [internal] + * ConfirmDialog [internal] * * Put up a confirm box, return TRUE if the user confirmed */ @@ -632,7 +657,7 @@ /************************************************************************* - * RestartDialogEx [SHELL32.730] + * RestartDialogEx [SHELL32.730] */ int WINAPI RestartDialogEx(HWND hWndOwner, LPCWSTR lpwstrReason, DWORD uFlags, DWORD uReason) @@ -675,7 +700,7 @@ /************************************************************************* - * RestartDialog [SHELL32.59] + * RestartDialog [SHELL32.59] */ int WINAPI RestartDialog(HWND hWndOwner, LPCWSTR lpstrReason, DWORD uFlags) @@ -685,7 +710,7 @@ /************************************************************************* - * ExitWindowsDialog [SHELL32.60] + * ExitWindowsDialog [SHELL32.60] * * NOTES * exported by ordinal Modified: branches/shell32_new-bringup/dll/win32/shell32/enumidlist.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
============================================================================== --- branches/shell32_new-bringup/dll/win32/shell32/enumidlist.cpp [iso-8859-1] (original) +++ branches/shell32_new-bringup/dll/win32/shell32/enumidlist.cpp [iso-8859-1] Wed Sep 7 23:21:02 2011 @@ -1,7 +1,7 @@ /* - * IEnumIDList - * - * Copyright 1998 Juergen Schmied <juergen.schmied(a)metronet.de> + * IEnumIDList + * + * Copyright 1998 Juergen Schmied <juergen.schmied(a)metronet.de> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,9 +24,9 @@ IEnumIDListImpl::IEnumIDListImpl() { - mpFirst = NULL; - mpLast = NULL; - mpCurrent = NULL; + mpFirst = NULL; + mpLast = NULL; + mpCurrent = NULL; } IEnumIDListImpl::~IEnumIDListImpl() @@ -38,39 +38,39 @@ */ BOOL IEnumIDListImpl::AddToEnumList(LPITEMIDLIST pidl) { - ENUMLIST *pNew; - - TRACE("(%p)->(pidl=%p)\n", this, pidl); - - if (!pidl) - return FALSE; - - pNew = (ENUMLIST *)SHAlloc(sizeof(ENUMLIST)); - if (pNew) - { - /*set the next pointer */ - pNew->pNext = NULL; - pNew->pidl = pidl; - - /*is This the first item in the list? */ - if (!mpFirst) - { - mpFirst = pNew; - mpCurrent = pNew; - } - - if (mpLast) - { - /*add the new item to the end of the list */ - mpLast->pNext = pNew; - } - - /*update the last item pointer */ - mpLast = pNew; - TRACE("-- (%p)->(first=%p, last=%p)\n", this, mpFirst, mpLast); - return TRUE; - } - return FALSE; + ENUMLIST *pNew; + + TRACE("(%p)->(pidl=%p)\n", this, pidl); + + if (!pidl) + return FALSE; + + pNew = (ENUMLIST *)SHAlloc(sizeof(ENUMLIST)); + if (pNew) + { + /*set the next pointer */ + pNew->pNext = NULL; + pNew->pidl = pidl; + + /*is This the first item in the list? */ + if (!mpFirst) + { + mpFirst = pNew; + mpCurrent = pNew; + } + + if (mpLast) + { + /*add the new item to the end of the list */ + mpLast->pNext = pNew; + } + + /*update the last item pointer */ + mpLast = pNew; + TRACE("-- (%p)->(first=%p, last=%p)\n", this, mpFirst, mpLast); + return TRUE; + } + return FALSE; } /************************************************************************** @@ -78,21 +78,21 @@ */ BOOL IEnumIDListImpl::DeleteList() { - ENUMLIST *pDelete; - - TRACE("(%p)->()\n", this); - - while (mpFirst) - { - pDelete = mpFirst; - mpFirst = pDelete->pNext; - SHFree(pDelete->pidl); - SHFree(pDelete); - } - mpFirst = NULL; - mpLast = NULL; - mpCurrent = NULL; - return TRUE; + ENUMLIST *pDelete; + + TRACE("(%p)->()\n", this); + + while (mpFirst) + { + pDelete = mpFirst; + mpFirst = pDelete->pNext; + SHFree(pDelete->pidl); + SHFree(pDelete); + } + mpFirst = NULL; + mpLast = NULL; + mpCurrent = NULL; + return TRUE; } /************************************************************************** @@ -100,20 +100,25 @@ */ BOOL IEnumIDListImpl::HasItemWithCLSID(LPITEMIDLIST pidl) { - ENUMLIST *pCur; - REFIID refid = *_ILGetGUIDPointer(pidl); - - pCur = mpFirst; - - while(pCur) - { - LPGUID curid = _ILGetGUIDPointer(pCur->pidl); - if (curid && IsEqualGUID(*curid, refid)) + ENUMLIST *pCur; + IID *ptr = _ILGetGUIDPointer(pidl); + + if (ptr) + { + REFIID refid = *ptr; + pCur = mpFirst; + + while(pCur) { - return TRUE; + LPGUID curid = _ILGetGUIDPointer(pCur->pidl); + if (curid && IsEqualGUID(*curid, refid)) + { + return TRUE; + } + pCur = pCur->pNext; } - pCur = pCur->pNext; - } + } + return FALSE; } @@ -122,8 +127,8 @@ * CreateFolderEnumList() */ BOOL IEnumIDListImpl::CreateFolderEnumList( - LPCWSTR lpszPath, - DWORD dwFlags) + LPCWSTR lpszPath, + DWORD dwFlags) { LPITEMIDLIST pidl=NULL; WIN32_FIND_DATAW stffile; @@ -179,6 +184,7 @@ } while (succeeded && !findFinished); FindClose(hFile); } + return succeeded; } @@ -187,66 +193,66 @@ */ HRESULT WINAPI IEnumIDListImpl::Next( - ULONG celt, - LPITEMIDLIST * rgelt, - ULONG *pceltFetched) -{ - ULONG i; - HRESULT hr = S_OK; - LPITEMIDLIST temp; - - TRACE("(%p)->(%d,%p, %p)\n", this, celt, rgelt, pceltFetched); + ULONG celt, + LPITEMIDLIST * rgelt, + ULONG *pceltFetched) +{ + ULONG i; + HRESULT hr = S_OK; + LPITEMIDLIST temp; + + TRACE("(%p)->(%d,%p, %p)\n", this, celt, rgelt, pceltFetched); /* It is valid to leave pceltFetched NULL when celt is 1. Some of explorer's * subsystems actually use it (and so may a third party browser) */ - if(pceltFetched) - *pceltFetched = 0; - - *rgelt=0; - - if(celt > 1 && !pceltFetched) - { return E_INVALIDARG; - } - - if(celt > 0 && !mpCurrent) - { return S_FALSE; - } - - for(i = 0; i < celt; i++) - { if(!mpCurrent) - break; - - temp = ILClone(mpCurrent->pidl); - rgelt[i] = temp; - mpCurrent = mpCurrent->pNext; - } - if(pceltFetched) - { *pceltFetched = i; - } - - return hr; + if(pceltFetched) + *pceltFetched = 0; + + *rgelt=0; + + if(celt > 1 && !pceltFetched) + { return E_INVALIDARG; + } + + if(celt > 0 && !mpCurrent) + { return S_FALSE; + } + + for(i = 0; i < celt; i++) + { if(!mpCurrent) + break; + + temp = ILClone(mpCurrent->pidl); + rgelt[i] = temp; + mpCurrent = mpCurrent->pNext; + } + if(pceltFetched) + { *pceltFetched = i; + } + + return hr; } /************************************************************************** * IEnumIDList_fnSkip */ HRESULT WINAPI IEnumIDListImpl::Skip( - ULONG celt) -{ - DWORD dwIndex; - HRESULT hr = S_OK; - - TRACE("(%p)->(%u)\n", this, celt); - - for(dwIndex = 0; dwIndex < celt; dwIndex++) - { if(!mpCurrent) - { hr = S_FALSE; - break; - } - mpCurrent = mpCurrent->pNext; - } - return hr; + ULONG celt) +{ + DWORD dwIndex; + HRESULT hr = S_OK; + + TRACE("(%p)->(%u)\n", this, celt); + + for(dwIndex = 0; dwIndex < celt; dwIndex++) + { if(!mpCurrent) + { hr = S_FALSE; + break; + } + mpCurrent = mpCurrent->pNext; + } + return hr; } /************************************************************************** @@ -254,9 +260,9 @@ */ HRESULT WINAPI IEnumIDListImpl::Reset() { - TRACE("(%p)\n", this); - mpCurrent = mpFirst; - return S_OK; + TRACE("(%p)\n", this); + mpCurrent = mpFirst; + return S_OK; } /************************************************************************** @@ -264,8 +270,8 @@ */ HRESULT WINAPI IEnumIDListImpl::Clone(LPENUMIDLIST *ppenum) { - TRACE("(%p)->() to (%p)->() E_NOTIMPL\n", this, ppenum); - return E_NOTIMPL; + TRACE("(%p)->() to (%p)->() E_NOTIMPL\n", this, ppenum); + return E_NOTIMPL; } /************************************************************************** @@ -274,22 +280,22 @@ */ HRESULT IEnumIDList_Constructor(IEnumIDList **enumerator) { - CComObject<IEnumIDListImpl> *theEnumerator; - CComPtr<IEnumIDList> result; - HRESULT hResult; - - if (enumerator == NULL) - return E_POINTER; - *enumerator = NULL; - ATLTRY (theEnumerator = new CComObject<IEnumIDListImpl>); - if (theEnumerator == NULL) - return E_OUTOFMEMORY; - hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result); - if (FAILED (hResult)) - { - delete theEnumerator; - return hResult; - } - *enumerator = result.Detach (); - return S_OK; -} + CComObject<IEnumIDListImpl> *theEnumerator; + CComPtr<IEnumIDList> result; + HRESULT hResult; + + if (enumerator == NULL) + return E_POINTER; + *enumerator = NULL; + ATLTRY (theEnumerator = new CComObject<IEnumIDListImpl>); + if (theEnumerator == NULL) + return E_OUTOFMEMORY; + hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result); + if (FAILED (hResult)) + { + delete theEnumerator; + return hResult; + } + *enumerator = result.Detach (); + return S_OK; +} Modified: branches/shell32_new-bringup/dll/win32/shell32/shfldr_mycomp.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
============================================================================== --- branches/shell32_new-bringup/dll/win32/shell32/shfldr_mycomp.cpp [iso-8859-1] (original) +++ branches/shell32_new-bringup/dll/win32/shell32/shfldr_mycomp.cpp [iso-8859-1] Wed Sep 7 23:21:02 2011 @@ -77,6 +77,8 @@ HRESULT WINAPI CDrivesFolderEnum::Initialize(HWND hwndOwner, DWORD dwFlags) { + DbgPrint("[shell32, CDrivesFolderEnum::Initialize] Called with flags = %d\n", dwFlags); + if (CreateMyCompEnumList(dwFlags) == FALSE) return E_FAIL; return S_OK; @@ -97,6 +99,8 @@ TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags); + DbgPrint("[shell32, CDrivesFolderEnum::CreateMyCompEnumList] Called with flags = %d\n", dwFlags); + /* enumerate the folders */ if (dwFlags & SHCONTF_FOLDERS) { @@ -114,7 +118,8 @@ } TRACE("-- (%p)-> enumerate (mycomputer shell extensions)\n", this); - for (i=0; i<2; i++) { + for (i=0; i<2; i++) + { if (ret && !RegOpenKeyExW(i == 0 ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, MyComputer_NameSpaceW, 0, KEY_READ, &hkey)) { @@ -255,19 +260,27 @@ TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList); + DbgPrint("[shell32, CDrivesFolder::EnumObjects] Called with flags = %d\n", dwFlags); + if (ppEnumIDList == NULL) return E_POINTER; - *ppEnumIDList = NULL; + + *ppEnumIDList = NULL; ATLTRY (theEnumerator = new CComObject<CDrivesFolderEnum>); - if (theEnumerator == NULL) + + if (theEnumerator == NULL) return E_OUTOFMEMORY; - hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result); + + hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result); if (FAILED (hResult)) { delete theEnumerator; return hResult; } - hResult = theEnumerator->Initialize (hwndOwner, dwFlags); + + DbgPrint("[shell32, CDrivesFolder::EnumObjects] Calling theEnumerator->Initialize\n"); + + hResult = theEnumerator->Initialize (hwndOwner, dwFlags); if (FAILED (hResult)) return hResult; *ppEnumIDList = result.Detach (); Modified: branches/shell32_new-bringup/dll/win32/shell32/shfldr_printers.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
============================================================================== --- branches/shell32_new-bringup/dll/win32/shell32/shfldr_printers.cpp [iso-8859-1] (original) +++ branches/shell32_new-bringup/dll/win32/shell32/shfldr_printers.cpp [iso-8859-1] Wed Sep 7 23:21:02 2011 @@ -29,28 +29,28 @@ * Printers_IExtractIconW implementation */ class IExtractIconWImpl : - public CComObjectRootEx<CComMultiThreadModelNoCS>, - public IExtractIconW, - public IExtractIconA + public CComObjectRootEx<CComMultiThreadModelNoCS>, + public IExtractIconW, + public IExtractIconA { private: - LPITEMIDLIST pidl; + LPITEMIDLIST pidl; public: - IExtractIconWImpl(); - ~IExtractIconWImpl(); - HRESULT WINAPI Initialize(LPCITEMIDLIST pidl); - - // IExtractIconW + IExtractIconWImpl(); + ~IExtractIconWImpl(); + HRESULT WINAPI Initialize(LPCITEMIDLIST pidl); + + // IExtractIconW virtual HRESULT STDMETHODCALLTYPE GetIconLocation(UINT uFlags, LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags); virtual HRESULT STDMETHODCALLTYPE Extract(LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize); - // IExtractIconA + // IExtractIconA virtual HRESULT STDMETHODCALLTYPE GetIconLocation(UINT uFlags, LPSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags); virtual HRESULT STDMETHODCALLTYPE Extract(LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize); BEGIN_COM_MAP(IExtractIconWImpl) - COM_INTERFACE_ENTRY_IID(IID_IExtractIconW, IExtractIconW) - COM_INTERFACE_ENTRY_IID(IID_IExtractIconA, IExtractIconA) + COM_INTERFACE_ENTRY_IID(IID_IExtractIconW, IExtractIconW) + COM_INTERFACE_ENTRY_IID(IID_IExtractIconA, IExtractIconA) END_COM_MAP() }; @@ -75,7 +75,7 @@ IExtractIconWImpl::IExtractIconWImpl() { - pidl = NULL; + pidl = NULL; } IExtractIconWImpl::~IExtractIconWImpl() @@ -89,7 +89,7 @@ pidl = ILClone(pidl); pdump(pidl); - return S_OK; + return S_OK; } /************************************************************************** @@ -97,11 +97,11 @@ * * mapping filetype to icon */ -HRESULT WINAPI IExtractIconWImpl::GetIconLocation(UINT uFlags, /* GIL_ flags */ +HRESULT WINAPI IExtractIconWImpl::GetIconLocation(UINT uFlags, /* GIL_ flags */ LPWSTR szIconFile, UINT cchMax, int *piIndex, - UINT *pwFlags) /* returned GIL_ flags */ + UINT *pwFlags) /* returned GIL_ flags */ { TRACE("(%p) (flags=%u %p %u %p %p)\n", this, uFlags, szIconFile, cchMax, piIndex, pwFlags); @@ -142,10 +142,10 @@ * IExtractIconA_GetIconLocation */ HRESULT WINAPI IExtractIconWImpl::GetIconLocation(UINT uFlags, - LPSTR szIconFile, - UINT cchMax, - int * piIndex, - UINT * pwFlags) + LPSTR szIconFile, + UINT cchMax, + int * piIndex, + UINT * pwFlags) { HRESULT ret; LPWSTR lpwstrFile = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, cchMax * sizeof(WCHAR)); @@ -183,27 +183,27 @@ */ static HRESULT WINAPI IEI_Printers_Constructor(LPCITEMIDLIST pidl, REFIID riid, IUnknown **ppv) { - CComObject<IExtractIconWImpl> *theExtractor; - CComPtr<IUnknown> result; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY (theExtractor = new CComObject<IExtractIconWImpl>); - if (theExtractor == NULL) - return E_OUTOFMEMORY; - hResult = theExtractor->QueryInterface (riid, (void **)&result); - if (FAILED (hResult)) - { - delete theExtractor; - return hResult; - } - hResult = theExtractor->Initialize (pidl); - if (FAILED (hResult)) - return hResult; - *ppv = result.Detach (); - return S_OK; + CComObject<IExtractIconWImpl> *theExtractor; + CComPtr<IUnknown> result; + HRESULT hResult; + + if (ppv == NULL) + return E_POINTER; + *ppv = NULL; + ATLTRY (theExtractor = new CComObject<IExtractIconWImpl>); + if (theExtractor == NULL) + return E_OUTOFMEMORY; + hResult = theExtractor->QueryInterface (riid, (void **)&result); + if (FAILED (hResult)) + { + delete theExtractor; + return hResult; + } + hResult = theExtractor->Initialize (pidl); + if (FAILED (hResult)) + return hResult; + *ppv = result.Detach (); + return S_OK; } /*********************************************************************** @@ -211,17 +211,17 @@ */ class CPrintersEnum : - public IEnumIDListImpl + public IEnumIDListImpl { private: public: - CPrintersEnum(); - ~CPrintersEnum(); - HRESULT WINAPI Initialize(HWND hwndOwner, DWORD dwFlags); - BOOL CreatePrintersEnumList(DWORD dwFlags); + CPrintersEnum(); + ~CPrintersEnum(); + HRESULT WINAPI Initialize(HWND hwndOwner, DWORD dwFlags); + BOOL CreatePrintersEnumList(DWORD dwFlags); BEGIN_COM_MAP(CPrintersEnum) - COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList) + COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList) END_COM_MAP() }; @@ -235,9 +235,9 @@ HRESULT WINAPI CPrintersEnum::Initialize(HWND hwndOwner, DWORD dwFlags) { - if (CreatePrintersEnumList(dwFlags) == FALSE) - return E_FAIL; - return S_OK; + if (CreatePrintersEnumList(dwFlags) == FALSE) + return E_FAIL; + return S_OK; } static LPITEMIDLIST _ILCreatePrinterItem(PRINTER_INFO_4W *pi) @@ -327,6 +327,7 @@ { pidlRoot = NULL; dwAttributes = 0; + pclsid = NULL; } CPrinterFolder::~CPrinterFolder() @@ -339,9 +340,9 @@ HRESULT WINAPI CPrinterFolder::FinalConstruct() { pidlRoot = _ILCreatePrinters(); /* my qualified pidl */ - if (pidlRoot == NULL) - return E_OUTOFMEMORY; - return S_OK; + if (pidlRoot == NULL) + return E_OUTOFMEMORY; + return S_OK; } /************************************************************************** @@ -378,32 +379,32 @@ */ HRESULT WINAPI CPrinterFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList) { - CComObject<CPrintersEnum> *theEnumerator; - CComPtr<IEnumIDList> result; - HRESULT hResult; - - TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList); - - if (ppEnumIDList == NULL) - return E_POINTER; - *ppEnumIDList = NULL; - ATLTRY (theEnumerator = new CComObject<CPrintersEnum>); - if (theEnumerator == NULL) - return E_OUTOFMEMORY; - hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result); - if (FAILED (hResult)) - { - delete theEnumerator; - return hResult; - } - hResult = theEnumerator->Initialize (hwndOwner, dwFlags); - if (FAILED (hResult)) - return hResult; - *ppEnumIDList = result.Detach (); + CComObject<CPrintersEnum> *theEnumerator; + CComPtr<IEnumIDList> result; + HRESULT hResult; + + TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList); + + if (ppEnumIDList == NULL) + return E_POINTER; + *ppEnumIDList = NULL; + ATLTRY (theEnumerator = new CComObject<CPrintersEnum>); + if (theEnumerator == NULL) + return E_OUTOFMEMORY; + hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result); + if (FAILED (hResult)) + { + delete theEnumerator; + return hResult; + } + hResult = theEnumerator->Initialize (hwndOwner, dwFlags); + if (FAILED (hResult)) + return hResult; + *ppEnumIDList = result.Detach (); TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList); - return S_OK; + return S_OK; } /************************************************************************** Modified: branches/shell32_new-bringup/dll/win32/shell32/shlexec.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
============================================================================== --- branches/shell32_new-bringup/dll/win32/shell32/shlexec.cpp [iso-8859-1] (original) +++ branches/shell32_new-bringup/dll/win32/shell32/shlexec.cpp [iso-8859-1] Wed Sep 7 23:21:02 2011 @@ -20,6 +20,7 @@ */ #include <precomp.h> +#include <windef.h> WINE_DEFAULT_DEBUG_CHANNEL(exec); Modified: branches/shell32_new-bringup/dll/win32/shell32/shv_def_cmenu.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
============================================================================== --- branches/shell32_new-bringup/dll/win32/shell32/shv_def_cmenu.cpp [iso-8859-1] (original) +++ branches/shell32_new-bringup/dll/win32/shell32/shv_def_cmenu.cpp [iso-8859-1] Wed Sep 7 23:21:02 2011 @@ -660,7 +660,7 @@ } else { - TRACE("Failed to laod string, defaulting to default (NULL) value for mii.dwTypeData\n"); + TRACE("Failed to load string, defaulting to NULL value for mii.dwTypeData\n"); } } else Modified: branches/shell32_new-bringup/dll/win32/shell32/shv_item_new.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
============================================================================== --- branches/shell32_new-bringup/dll/win32/shell32/shv_item_new.cpp [iso-8859-1] (original) +++ branches/shell32_new-bringup/dll/win32/shell32/shv_item_new.cpp [iso-8859-1] Wed Sep 7 23:21:02 2011 @@ -87,6 +87,21 @@ return TRUE; } +void CNewMenu::UnloadItem(SHELLNEW_ITEM *item) +{ + // bail if the item is clearly invalid + if (NULL == item) + return; + + if (NULL != item->szTarget) + free(item->szTarget); + + free(item->szDesc); + free(item->szIcon); + free(item->szExt); + + HeapFree(GetProcessHeap(), 0, item); +} CNewMenu::SHELLNEW_ITEM *CNewMenu::LoadItem(LPWSTR szKeyName) { Modified: branches/shell32_new-bringup/dll/win32/shell32/shv_item_new.h URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
============================================================================== --- branches/shell32_new-bringup/dll/win32/shell32/shv_item_new.h [iso-8859-1] (original) +++ branches/shell32_new-bringup/dll/win32/shell32/shv_item_new.h [iso-8859-1] Wed Sep 7 23:21:02 2011 @@ -56,6 +56,7 @@ CNewMenu(); ~CNewMenu(); SHELLNEW_ITEM *LoadItem(LPWSTR szKeyName); + void UnloadItem(SHELLNEW_ITEM *item); BOOL LoadShellNewItems(); UINT InsertShellNewItems(HMENU hMenu, UINT idFirst, UINT idMenu); HRESULT DoShellNewCmd(LPCMINVOKECOMMANDINFO lpcmi);
13 years, 3 months
1
0
0
0
[gadamopoulos] 53632: [user32_apitest] - Add some more tests hoping that SetActiveWindow will reveal its secrets
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Wed Sep 7 23:08:14 2011 New Revision: 53632 URL:
http://svn.reactos.org/svn/reactos?rev=53632&view=rev
Log: [user32_apitest] - Add some more tests hoping that SetActiveWindow will reveal its secrets Modified: trunk/rostests/apitests/user32/SetActiveWindow.c Modified: trunk/rostests/apitests/user32/SetActiveWindow.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/SetActive…
============================================================================== --- trunk/rostests/apitests/user32/SetActiveWindow.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/SetActiveWindow.c [iso-8859-1] Wed Sep 7 23:08:14 2011 @@ -9,41 +9,81 @@ #include <wine/test.h> #include <windows.h> + +#define EXPECT_NEXT(hWnd1, hWnd2) ok(GetWindow(hWnd1,GW_HWNDNEXT) == hWnd2, "Expected %p after %p, not %p\n",hWnd2,hWnd1,GetWindow(hWnd1,GW_HWNDNEXT) ) +#define EXPECT_ACTIVE(hwnd) ok(GetActiveWindow() == hwnd, "Expected %p to be the active window, not %p\n",hwnd,GetActiveWindow()) + void Test_SetActiveWindow() { MSG msg; - HWND hWnd, hWnd1, hWnd2; + HWND hWnd1, hWnd2, hWnd3, hWnd4; - hWnd = CreateWindowW(L"BUTTON", L"ownertest", WS_OVERLAPPEDWINDOW, + hWnd1 = CreateWindowW(L"BUTTON", L"ownertest", WS_OVERLAPPEDWINDOW, 20, 20, 300, 300, NULL, NULL, 0, NULL); - hWnd1 = CreateWindowW(L"BUTTON", L"ownertest", WS_OVERLAPPEDWINDOW, - 20, 350, 300, 300, hWnd, NULL, 0, NULL); + hWnd2 = CreateWindowW(L"BUTTON", L"ownertest", WS_OVERLAPPEDWINDOW, + 20, 350, 300, 300, hWnd1, NULL, 0, NULL); - hWnd2 = CreateWindowW(L"BUTTON", L"ownertest", WS_OVERLAPPEDWINDOW, + hWnd3 = CreateWindowW(L"BUTTON", L"ownertest", WS_OVERLAPPEDWINDOW, 200, 200, 300, 300, NULL, NULL, 0, NULL); - ShowWindow(hWnd, SW_SHOW); - UpdateWindow(hWnd); + hWnd4 = CreateWindowW(L"BUTTON", L"ownertest", WS_OVERLAPPEDWINDOW, + 250, 250, 200, 200, hWnd1, NULL, 0, NULL); + ShowWindow(hWnd1, SW_SHOW); UpdateWindow(hWnd1); + while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); + + EXPECT_NEXT(hWnd4,hWnd2); + EXPECT_NEXT(hWnd1,hWnd3); + ShowWindow(hWnd2, SW_SHOW); UpdateWindow(hWnd2); - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); - ok(GetWindow(hWnd2,GW_HWNDNEXT) == hWnd1, "Expected %p after %p, not %p\n",hWnd1,hWnd2,GetWindow(hWnd2,GW_HWNDNEXT) ); - ok(GetWindow(hWnd1,GW_HWNDNEXT) == hWnd, "Expected %p after %p, not %p\n",hWnd,hWnd1,GetWindow(hWnd1,GW_HWNDNEXT)); - ok(GetActiveWindow() == hWnd2, "Expected %p to be the active window, not %p\n",hWnd2,GetActiveWindow()); + EXPECT_NEXT(hWnd2,hWnd4); + EXPECT_NEXT(hWnd4,hWnd1); - SetActiveWindow(hWnd); - + ShowWindow(hWnd3, SW_SHOW); + UpdateWindow(hWnd3); while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); - /* note: the owned is moved on top of the three windows */ - ok(GetActiveWindow() == hWnd, "Expected %p to be the active window, not %p\n",hWnd,GetActiveWindow()); - ok(GetWindow(hWnd1,GW_HWNDNEXT) == hWnd, "Expected %p after %p, not %p\n",hWnd,hWnd1,GetWindow(hWnd1,GW_HWNDNEXT) ); - ok(GetWindow(hWnd,GW_HWNDNEXT) == hWnd2, "Expected %p after %p, not %p\n",hWnd2,hWnd,GetWindow(hWnd,GW_HWNDNEXT) ); + EXPECT_NEXT(hWnd3,hWnd2); + EXPECT_NEXT(hWnd2,hWnd4); + EXPECT_NEXT(hWnd4,hWnd1); + + ShowWindow(hWnd4, SW_SHOW); + UpdateWindow(hWnd4); + while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); + + EXPECT_NEXT(hWnd4,hWnd2); + EXPECT_NEXT(hWnd2,hWnd1); + EXPECT_NEXT(hWnd1,hWnd3); + EXPECT_ACTIVE(hWnd4); + + SetActiveWindow(hWnd1); + while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); + + EXPECT_NEXT(hWnd4,hWnd2); + EXPECT_NEXT(hWnd2,hWnd1); + EXPECT_NEXT(hWnd1,hWnd3); + EXPECT_ACTIVE(hWnd1); + + SetActiveWindow(hWnd3); + while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); + + EXPECT_NEXT(hWnd3,hWnd4); + EXPECT_NEXT(hWnd4,hWnd2); + EXPECT_NEXT(hWnd2,hWnd1); + EXPECT_ACTIVE(hWnd3); + + SetActiveWindow(hWnd2); + while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); + + EXPECT_NEXT(hWnd2,hWnd4); + EXPECT_NEXT(hWnd4,hWnd1); + EXPECT_NEXT(hWnd1,hWnd3); + EXPECT_ACTIVE(hWnd2); } START_TEST(SetActiveWindow)
13 years, 3 months
1
0
0
0
[tkreuzer] 53631: [HAL] - Don't use debug prints before the debugger is even initialized - acquire cmos spinlock when accessing the cmos registers - Fix amd64 build
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Sep 7 21:41:50 2011 New Revision: 53631 URL:
http://svn.reactos.org/svn/reactos?rev=53631&view=rev
Log: [HAL] - Don't use debug prints before the debugger is even initialized - acquire cmos spinlock when accessing the cmos registers - Fix amd64 build Modified: trunk/reactos/hal/halx86/apic/apic.c trunk/reactos/hal/halx86/apic/apic.h trunk/reactos/hal/halx86/apic/apictrap.S trunk/reactos/hal/halx86/apic/halinit_apic.c trunk/reactos/hal/halx86/apic/rtctimer.c trunk/reactos/hal/halx86/apic/tsc.h trunk/reactos/hal/halx86/apic/tsccal.S Modified: trunk/reactos/hal/halx86/apic/apic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/apic/apic.c?rev…
============================================================================== --- trunk/reactos/hal/halx86/apic/apic.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/apic/apic.c [iso-8859-1] Wed Sep 7 21:41:50 2011 @@ -220,8 +220,8 @@ __outbyte(PIC2_DATA_PORT, 0xFF); } - -VOID +VOID +NTAPI ApicInitializeLocalApic(ULONG Cpu) { APIC_BASE_ADRESS_REGISTER BaseRegister; @@ -233,9 +233,6 @@ BaseRegister.Enable = 1; BaseRegister.BootStrapCPUCore = (Cpu == 0); __writemsr(MSR_APIC_BASE, BaseRegister.Long); - - DPRINT1("ApicBase for Cpu %u PhysicalAddress = %p\n", Cpu, BaseRegister.BaseAddress); - DPRINT1("ApicVersion = 0x%lx\n", ApicRead(0x30)); /* Set spurious vector and SoftwareEnable to 1 */ SpIntRegister.Long = ApicRead(APIC_SIVR); @@ -283,24 +280,10 @@ LvtEntry.MessageType = APIC_MT_Fixed; ApicWrite(APIC_ERRLVTR, LvtEntry.Long); - DPRINT1("Error code = 0x%lx\n", ApicRead(0x280)); -} - -VOID -NTAPI -ApicInitializeProcessor( - IN ULONG ProcessorNumber, - IN PLOADER_PARAMETER_BLOCK LoaderBlock) -{ - DPRINT1("ApicInitializeProcessor(%ld)\n", ProcessorNumber); - - /* Initialize the local APIC for this cpu */ - ApicInitializeLocalApic(ProcessorNumber); - - /* Initialize the timer */ - ApicInitializeTimer(ProcessorNumber); - -} + /* Set the IRQL from the PCR */ + ApicSetCurrentIrql(KeGetPcr()->Irql); +} + VOID FORCEINLINE @@ -443,9 +426,6 @@ EFlags = __readeflags(); _disable(); - /* Initialize the local APIC for this cpu */ - ApicInitializeLocalApic(0); - /* Initialize and mask the PIC */ HalpInitializeLegacyPIC(); @@ -455,21 +435,10 @@ /* Register interrupt handlers */ KeRegisterInterruptHandler(APIC_CLOCK_VECTOR, HalpClockInterrupt); +#ifndef _M_AMD64 KeRegisterInterruptHandler(APC_VECTOR, HalpApcInterrupt); KeRegisterInterruptHandler(DPC_VECTOR, HalpDispatchInterrupt); - - // HACK, since we messed with the value, should init the local apic in - // HalInitializeProcessor instead - ApicSetCurrentIrql(APC_LEVEL); - ASSERT(ApicGetProcessorIrql() <= APC_LEVEL); - -__debugbreak(); - -HalpInitializeClock(); -//HalpCalibrateStallExecution(); -_enable(); -for (;;); - +#endif /* Restore interrupt state */ if (EnableInterrupts) EFlags |= EFLAGS_INTERRUPT_MASK; @@ -488,6 +457,7 @@ ASSERT(FALSE); } +#ifndef _M_AMD64 VOID DECLSPEC_NORETURN FASTCALL @@ -512,7 +482,7 @@ /* Exit the interrupt */ KiEoiHelper(TrapFrame); } - +#endif /* PUBLIC FUNCTIONS ***********************************************************/ @@ -592,6 +562,7 @@ IOApicWrite(IOAPIC_REDTBL + 2 * Irql, ReDirReg.Long0); } +#ifndef _M_AMD64 BOOLEAN NTAPI HalBeginSystemInterrupt( @@ -625,7 +596,6 @@ ApicWrite(APIC_EOI, 0); } -#ifndef _M_AMD64 KIRQL NTAPI @@ -659,7 +629,7 @@ { KIRQL OldIrql; - /* Read the current TPR and convert it to an IRQL */ + /* Read the current IRQL */ OldIrql = ApicGetCurrentIrql(); #if DBG /* Validate correct raise */ @@ -672,6 +642,7 @@ /* Convert the new IRQL to a TPR value and write the register */ ApicSetCurrentIrql(NewIrql); + /* Return old IRQL */ return OldIrql; } Modified: trunk/reactos/hal/halx86/apic/apic.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/apic/apic.h?rev…
============================================================================== --- trunk/reactos/hal/halx86/apic/apic.h [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/apic/apic.h [iso-8859-1] Wed Sep 7 21:41:50 2011 @@ -1,6 +1,7 @@ #ifdef _M_AMD64 -#define APIC_BASE 0xfffffffffee00000ULL; +#define APIC_BASE 0xFFFFFFFFFEE00000ULL +#define IOAPIC_BASE 0xFFFFFFFFFEE01000ULL // checkme #define ZERO_VECTOR 0x00 // IRQL 00 #define APC_VECTOR 0x3D // IRQL 01 #define APIC_SPURIOUS_VECTOR 0x3f @@ -18,7 +19,6 @@ #else #define APIC_BASE 0xFFFE0000 #define IOAPIC_BASE 0xFFFE1000 // checkme -#define IOAPIC_PHYS_BASE 0xFEC00000 #define ZERO_VECTOR 0x00 // IRQL 00 #define APIC_SPURIOUS_VECTOR 0x1f #define APC_VECTOR 0x3D // IRQL 01 @@ -36,6 +36,7 @@ #endif #define MSR_APIC_BASE 0x0000001B +#define IOAPIC_PHYS_BASE 0xFEC00000 #define APIC_CLOCK_INDEX 8 Modified: trunk/reactos/hal/halx86/apic/apictrap.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/apic/apictrap.S…
============================================================================== --- trunk/reactos/hal/halx86/apic/apictrap.S [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/apic/apictrap.S [iso-8859-1] Wed Sep 7 21:41:50 2011 @@ -9,25 +9,32 @@ /* INCLUDES ******************************************************************/ #include <asm.inc> -#include <internal/i386/asmmacro.S> #ifdef _M_AMD64 #include <ksamd64.inc> +#include <trapamd64.inc> +#define KI_PUSH_FAKE_ERROR_CODE TF_PUSH_FAKE_ERROR_CODE PUBLIC ApicSpuriousService #else #include <ks386.inc> +#include <internal/i386/asmmacro.S> PUBLIC _ApicSpuriousService #endif .code +#ifndef _M_AMD64 TRAP_ENTRY HalpTrap0D, 0 -TRAP_ENTRY HalpApcInterrupt, KI_SOFTWARE_TRAP +TRAP_ENTRY HalpApcInterrupt, KI_PUSH_FAKE_ERROR_CODE TRAP_ENTRY HalpDispatchInterrupt, KI_PUSH_FAKE_ERROR_CODE +#endif TRAP_ENTRY HalpClockInterrupt, KI_PUSH_FAKE_ERROR_CODE TRAP_ENTRY HalpProfileInterrupt, KI_PUSH_FAKE_ERROR_CODE FUNC ApicSpuriousService +#ifdef _M_AMD64 + .ENDPROLOG +#endif int 3 iret ENDFUNC ApicSpuriousService Modified: trunk/reactos/hal/halx86/apic/halinit_apic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/apic/halinit_ap…
============================================================================== --- trunk/reactos/hal/halx86/apic/halinit_apic.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/apic/halinit_apic.c [iso-8859-1] Wed Sep 7 21:41:50 2011 @@ -27,8 +27,6 @@ IN ULONG ProcessorNumber, IN PLOADER_PARAMETER_BLOCK LoaderBlock) { - DPRINT1("ApicInitializeProcessor(%ld)\n", ProcessorNumber); - /* Initialize the local APIC for this cpu */ ApicInitializeLocalApic(ProcessorNumber); Modified: trunk/reactos/hal/halx86/apic/rtctimer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/apic/rtctimer.c…
============================================================================== --- trunk/reactos/hal/halx86/apic/rtctimer.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/apic/rtctimer.c [iso-8859-1] Wed Sep 7 21:41:50 2011 @@ -42,6 +42,9 @@ EFlags = __readeflags(); _disable(); + /* Acquire CMOS lock */ + HalpAcquireCmosSpinLock(); + // TODO: disable NMI /* Read value of register A */ @@ -53,6 +56,9 @@ /* Write the new value */ HalpWriteCmos(RTC_REGISTER_A, RegisterA); + + /* Release CMOS lock */ + HalpReleaseCmosSpinLock(); /* Restore interrupts if they were previously enabled */ __writeeflags(EFlags); @@ -67,9 +73,15 @@ UCHAR RegisterB; // TODO: disable NMI + /* Acquire CMOS lock */ + HalpAcquireCmosSpinLock(); + /* Enable the periodic interrupt in the CMOS */ RegisterB = HalpReadCmos(RTC_REGISTER_B); HalpWriteCmos(RTC_REGISTER_B, RegisterB | RTC_REG_B_PI); + + /* Release CMOS lock */ + HalpReleaseCmosSpinLock(); // RtcSetClockRate(HalpCurrentRate); } @@ -84,8 +96,9 @@ /* Enter trap */ KiEnterInterruptTrap(TrapFrame); __debugbreak(); + /* Start the interrupt */ - if (HalBeginSystemInterrupt(CLOCK2_LEVEL, PRIMARY_VECTOR_BASE, &Irql)) + if (HalBeginSystemInterrupt(CLOCK_LEVEL, PRIMARY_VECTOR_BASE, &Irql)) { /* Read register C, so that the next interrupt can happen */ HalpReadCmos(RTC_REGISTER_C);; Modified: trunk/reactos/hal/halx86/apic/tsc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/apic/tsc.h?rev=…
============================================================================== --- trunk/reactos/hal/halx86/apic/tsc.h [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/apic/tsc.h [iso-8859-1] Wed Sep 7 21:41:50 2011 @@ -9,7 +9,10 @@ extern LARGE_INTEGER HalpCpuClockFrequency; VOID NTAPI HalpInitializeTsc(); - +#ifdef _M_AMD64 +#define KiGetIdtEntry(Pcr, Vector) &((Pcr)->IdtBase[Vector]) +#else #define KiGetIdtEntry(Pcr, Vector) &((Pcr)->IDT[Vector]) +#endif #endif Modified: trunk/reactos/hal/halx86/apic/tsccal.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/apic/tsccal.S?r…
============================================================================== --- trunk/reactos/hal/halx86/apic/tsccal.S [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/apic/tsccal.S [iso-8859-1] Wed Sep 7 21:41:50 2011 @@ -3,6 +3,8 @@ #include "tsc.h" .code + +#ifdef _M_IX86 EXTERN _TscCalibrationPhase:BYTE EXTERN _TscCalibrationArray:QWORD @@ -36,4 +38,43 @@ pop eax iretd +#else + +EXTERN TscCalibrationPhase:BYTE +EXTERN TscCalibrationArray:DWORD + +PUBLIC TscCalibrationISR +FUNC TscCalibrationISR + push rax + push rcx + push rdx + .ENDPROLOG + + /* The first thing we do is read the current TSC value */ + rdtsc + + /* Read the current phase */ + movzx rcx, byte ptr [TscCalibrationPhase] + + /* Check if we're already done */ + cmp cl, NUM_SAMPLES + jnb CalibrationISR_Exit + + /* Store the current value */ + shl rcx, 1 + lea rax, [TscCalibrationArray] + mov dword ptr [rax + rcx], eax + mov dword ptr [rax + rcx + 4], edx + + /* Advance phase */ + inc byte ptr [TscCalibrationPhase] + +CalibrationISR_Exit: + pop rdx + pop rcx + pop rax + iretq +ENDFUNC TscCalibrationISR +#endif + END
13 years, 3 months
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
40
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Results per page:
10
25
50
100
200