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
June 2017
----- 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
526 discussions
Start a n
N
ew thread
[ashaposhnikov] 74771: [RAPPS] * Added STRINGTABLE entries for installation status in en-US.rc and ru-RU.rc
by ashaposhnikov@svn.reactos.org
Author: ashaposhnikov Date: Sat Jun 3 17:20:07 2017 New Revision: 74771 URL:
http://svn.reactos.org/svn/reactos?rev=74771&view=rev
Log: [RAPPS] * Added STRINGTABLE entries for installation status in en-US.rc and ru-RU.rc Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/ru-RU.rc Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
============================================================================== --- branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1] (original) +++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1] Sat Jun 3 17:20:07 2017 @@ -206,3 +206,13 @@ IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." END + +STRINGTABLE +BEGIN + IDS_STATUS_INSTALLED "Installed" + IDS_STATUS_NOTINSTALLED "Not installed" + IDS_STATUS_DOWNLOADED "Downloaded" + IDS_STATUS_UPDATE_AVAILABLE "Update available" + IDS_STATUS_DOWNLOADING "Downloadingâ¦" + IDS_STATUS_INSTALLING "Installingâ¦" +END Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
============================================================================== --- branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/ru-RU.rc [iso-8859-1] (original) +++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/ru-RU.rc [iso-8859-1] Sat Jun 3 17:20:07 2017 @@ -206,3 +206,13 @@ IDS_INTERRUPTED_DOWNLOAD "ÐагÑÑзка бÑла пÑеÑвана. ÐÑовеÑÑÑе подклÑÑение к ÑеÑи ÐнÑеÑнеÑ." IDS_UNABLE_TO_WRITE "Ðе ÑдалоÑÑ Ð·Ð°Ð¿Ð¸ÑаÑÑ Ð´Ð°Ð½Ð½Ñе на диÑк. Ðозможно, недоÑÑаÑоÑно Ñвободного меÑÑа на диÑке." END + +STRINGTABLE +BEGIN + IDS_STATUS_INSTALLED "УÑÑановлено" + IDS_STATUS_NOTINSTALLED "Ðе ÑÑÑановлено" + IDS_STATUS_DOWNLOADED "ÐагÑÑжено" + IDS_STATUS_UPDATE_AVAILABLE "ÐÑÑÑ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ" + IDS_STATUS_DOWNLOADING "ÐагÑÑжаеÑÑÑâ¦" + IDS_STATUS_INSTALLING "УÑÑановкаâ¦" +END
7 years, 6 months
1
0
0
0
[pschweitzer] 74770: [UDFS] Fix broken KdPrint
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sat Jun 3 16:54:18 2017 New Revision: 74770 URL:
http://svn.reactos.org/svn/reactos?rev=74770&view=rev
Log: [UDFS] Fix broken KdPrint Modified: trunk/reactos/drivers/filesystems/udfs/fscntrl.cpp Modified: trunk/reactos/drivers/filesystems/udfs/fscntrl.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/f…
============================================================================== --- trunk/reactos/drivers/filesystems/udfs/fscntrl.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/udfs/fscntrl.cpp [iso-8859-1] Sat Jun 3 16:54:18 2017 @@ -348,7 +348,7 @@ // KdPrint(("Build " VER_STR_PRODUCT "\n\n")); fsDeviceObject = PtrIrpContext->TargetDeviceObject; - KdPrint(("Mount on device object %x\n")); + KdPrint(("Mount on device object %x\n", fsDeviceObject)); filterDevExt = (PFILTER_DEV_EXTENSION)fsDeviceObject->DeviceExtension; if (filterDevExt->NodeIdentifier.NodeType == UDF_NODE_TYPE_FILTER_DEVOBJ && filterDevExt->NodeIdentifier.NodeSize == sizeof(FILTER_DEV_EXTENSION)) {
7 years, 6 months
1
0
0
0
[hbelusca] 74769: [BOOTDATA]: This commit is a HACK! Due to strange PnP drivers disconnections(*) happening, in particular those concerning keyboard drivers, thus making 1st-stage unusable, I fork ...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sat Jun 3 16:53:02 2017 New Revision: 74769 URL:
http://svn.reactos.org/svn/reactos?rev=74769&view=rev
Log: [BOOTDATA]: This commit is a HACK! Due to strange PnP drivers disconnections(*) happening, in particular those concerning keyboard drivers, thus making 1st-stage unusable, I fork off hivesys.inf into hivesetup.inf, remove the listed PnP devices that seem to cause problems, and use it (instead of hivesys.inf) to build the 1st-stage setup SYSTEM registry hive. 2nd-stage and regular installations on the contrary use the normal hivesys.inf. (*): disconnections mentioning (this refers to the 'i8042prt.sys' driver): "Removal vetoed by Root\*PNP0303\0000" [...] "Warning: PnP Start failed (Root\*PNP0303\0000) [Status: 0xc0000010]" and "A reboot is required for the current driver for 'Root\*PNP0303\0000' to be replaced" Added: branches/setup_improvements/boot/bootdata/hivesetup.inf - copied, changed from r74767, branches/setup_improvements/boot/bootdata/hivesys.inf Modified: branches/setup_improvements/sdk/cmake/CMakeMacros.cmake Copied: branches/setup_improvements/boot/bootdata/hivesetup.inf (from r74767, branches/setup_improvements/boot/bootdata/hivesys.inf) URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/boot/bootdat…
============================================================================== --- branches/setup_improvements/boot/bootdata/hivesys.inf [iso-8859-1] (original) +++ branches/setup_improvements/boot/bootdata/hivesetup.inf [iso-8859-1] Sat Jun 3 16:53:02 2017 @@ -23,45 +23,9 @@ HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0C08","Service",0x00000000,"acpi" HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0C08","ClassGUID",0x00000000,"{4D36E97D-E325-11CE-BFC1-08002BE10318}" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#CC_0C0300","Service",0x00000000,"usbuhci" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#CC_0C0300","ClassGUID",0x00000000,"{36FC9E60-C465-11CF-8056-444553540000}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#CC_0C0310","Service",0x00000000,"usbohci" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#CC_0C0310","ClassGUID",0x00000000,"{36FC9E60-C465-11CF-8056-444553540000}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#CC_0C0320","Service",0x00000000,"usbehci" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#CC_0C0320","ClassGUID",0x00000000,"{36FC9E60-C465-11CF-8056-444553540000}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\USB#Class_08&SubClass_06&Prot_50","Service",0x00000000,"usbstor" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\USB#Class_08&SubClass_06&Prot_50","ClassGUID",0x00000000,"{36FC9E60-C465-11CF-8056-444553540000}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\USB#COMPOSITE","Service",0x00000000,"usbccgp" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\USB#COMPOSITE","ClassGUID",0x00000000,"{36FC9E60-C465-11CF-8056-444553540000}" - -;HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\USB#CLASS_09","Service",0x00000000,"usbhub" -;HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\USB#CLASS_09","ClassGUID",0x00000000,"{36FC9E60-C465-11CF-8056-444553540000}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\USB#ROOT_HUB","Service",0x00000000,"usbhub" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\USB#ROOT_HUB","ClassGUID",0x00000000,"{36FC9E60-C465-11CF-8056-444553540000}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\USB#ROOT_HUB20","Service",0x00000000,"usbhub" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\USB#ROOT_HUB20","ClassGUID",0x00000000,"{36FC9E60-C465-11CF-8056-444553540000}" - HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\GenDisk","Service",0x00000000,"disk" HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\GenDisk","ClassGUID",0x00000000,"{4D36E967-E325-11CE-BFC1-08002BE10318}" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\USB#Class_03","Service",0x00000000,"hidusb" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\USB#Class_03","ClassGUID",0x00000000,"{745a17a0-74d3-11d0-b6fe-00a0c90f57da}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\GENERIC_HID_DEVICE","Service",0x00000000,"hidusb" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\GENERIC_HID_DEVICE","ClassGUID",0x00000000,"{745a17a0-74d3-11d0-b6fe-00a0c90f57da}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\HID_DEVICE_SYSTEM_KEYBOARD","Service",0x00000000,"kbdhid" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\HID_DEVICE_SYSTEM_KEYBOARD","ClassGUID",0x00000000,"{4D36E96B-E325-11CE-BFC1-08002BE10318}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\HID_DEVICE_SYSTEM_MOUSE","Service",0x00000000,"mouhid" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\HID_DEVICE_SYSTEM_MOUSE","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}" - HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#CC_0000","Service",0x00000000,"VBE" HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#CC_0000","ClassGUID",0x00000000,"{4D36E968-E325-11CE-BFC1-08002BE10318}" @@ -73,33 +37,6 @@ HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#CC_0301","Service",0x00000000,"VBE" HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#CC_0301","ClassGUID",0x00000000,"{4D36E968-E325-11CE-BFC1-08002BE10318}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0303","Service",0x00000000,"i8042prt" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0303","ClassGUID",0x00000000,"{4D36E96B-E325-11CE-BFC1-08002BE10318}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F0E","Service",0x00000000,"i8042prt" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F0E","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F19","Service",0x00000000,"i8042prt" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F19","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PS2_MOUSE","Service",0x00000000,"i8042prt" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PS2_MOUSE","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F13","Service",0x00000000,"i8042prt" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F13","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*IBM3780","Service",0x00000000,"i8042prt" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*IBM3780","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F12","Service",0x00000000,"i8042prt" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F12","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F03","Service",0x00000000,"i8042prt" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F03","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}" - -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\ROOT#SWENUM","Service",0x00000000,"swenum" -HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\ROOT#SWENUM","ClassGUID",0x00000000,"{4d36e97d-e325-11ce-bfc1-08002be10318}" HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot","AlternateShell",2,"cmd.exe" Modified: branches/setup_improvements/sdk/cmake/CMakeMacros.cmake URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/sdk/cmake/CM…
============================================================================== --- branches/setup_improvements/sdk/cmake/CMakeMacros.cmake [iso-8859-1] (original) +++ branches/setup_improvements/sdk/cmake/CMakeMacros.cmake [iso-8859-1] Sat Jun 3 16:53:02 2017 @@ -763,10 +763,11 @@ FOR bootcd regtest) # bootcd setup system hive + # FIXME: Should use hivesys_utf16.inf instead! add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/boot/bootdata/SETUPREG.HIV - COMMAND native-mkhive -h:SETUPREG -d:${CMAKE_BINARY_DIR}/boot/bootdata ${CMAKE_BINARY_DIR}/boot/bootdata/hivesys_utf16.inf - DEPENDS native-mkhive ${CMAKE_BINARY_DIR}/boot/bootdata/hivesys_utf16.inf) + COMMAND native-mkhive -h:SETUPREG -d:${CMAKE_BINARY_DIR}/boot/bootdata ${CMAKE_BINARY_DIR}/boot/bootdata/hivesetup_utf16.inf + DEPENDS native-mkhive ${CMAKE_BINARY_DIR}/boot/bootdata/hivesetup_utf16.inf) add_custom_target(bootcd_hives DEPENDS ${CMAKE_BINARY_DIR}/boot/bootdata/SETUPREG.HIV)
7 years, 6 months
1
0
0
0
[hbelusca] 74768: [MKHIVE]: Improve dprint output (delimiting where strings start & end: is useful for empty strings).
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sat Jun 3 16:41:00 2017 New Revision: 74768 URL:
http://svn.reactos.org/svn/reactos?rev=74768&view=rev
Log: [MKHIVE]: Improve dprint output (delimiting where strings start & end: is useful for empty strings). Modified: branches/setup_improvements/sdk/tools/mkhive/reginf.c Modified: branches/setup_improvements/sdk/tools/mkhive/reginf.c URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/sdk/tools/mk…
============================================================================== --- branches/setup_improvements/sdk/tools/mkhive/reginf.c [iso-8859-1] (original) +++ branches/setup_improvements/sdk/tools/mkhive/reginf.c [iso-8859-1] Sat Jun 3 16:41:00 2017 @@ -172,7 +172,7 @@ if (Total != Size) { - DPRINT("setting value %S to %S\n", ValueName, Buffer); + DPRINT("setting value '%S' to '%S'\n", ValueName, Buffer); RegSetValueExW(KeyHandle, ValueName, 0, @@ -290,6 +290,7 @@ if (Str == NULL) return TRUE; + DPRINT("append_multi_sz_value(ValueName = '%S')\n", ValueName); append_multi_sz_value(KeyHandle, ValueName, Str, @@ -319,7 +320,7 @@ { ULONG dw = Str ? strtoulW(Str, NULL, 0) : 0; - DPRINT("setting dword %S to %x\n", ValueName, dw); + DPRINT("setting dword '%S' to %x\n", ValueName, dw); RegSetValueExW(KeyHandle, ValueName, @@ -330,7 +331,7 @@ } else { - DPRINT("setting value %S to %S\n", ValueName, Str); + DPRINT("setting value '%S' to '%S'\n", ValueName, Str); if (Str) { @@ -366,7 +367,7 @@ if (Data == NULL) return FALSE; - DPRINT("setting binary data %S len %d\n", ValueName, Size); + DPRINT("setting binary data '%S' len %d\n", ValueName, Size); InfHostGetBinaryField(Context, 5, Data, Size, NULL); } @@ -400,7 +401,6 @@ HKEY KeyHandle; BOOL Ok; - Ok = InfHostFindFirstLine(hInf, Section, NULL, &Context) == 0; if (!Ok) return TRUE; /* Don't fail if the section isn't present */ @@ -501,7 +501,6 @@ } InfHostCloseFile(hInf); - return TRUE; }
7 years, 6 months
1
0
0
0
[hbelusca] 74767: Sync to trunk r74766.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sat Jun 3 16:35:45 2017 New Revision: 74767 URL:
http://svn.reactos.org/svn/reactos?rev=74767&view=rev
Log: Sync to trunk r74766. Modified: branches/setup_improvements/ (props changed) branches/setup_improvements/boot/bootdata/hivesys.inf branches/setup_improvements/dll/win32/kernel32/client/appcache.c branches/setup_improvements/dll/win32/mswsock/mswhelper.c branches/setup_improvements/dll/win32/mswsock/mswhelper.h branches/setup_improvements/dll/win32/mswsock/nsplookup.c branches/setup_improvements/dll/win32/netapi32/netapi32.spec branches/setup_improvements/dll/win32/netapi32/share.c branches/setup_improvements/dll/win32/netapi32/srvsvc.c branches/setup_improvements/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp branches/setup_improvements/dll/win32/shell32/shellmenu/CMenuDeskBar.h branches/setup_improvements/sdk/include/psdk/asptlb.idl branches/setup_improvements/win32ss/printing/providers/localspl/printers.c Propchange: branches/setup_improvements/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Jun 3 16:35:45 2017 @@ -23,4 +23,4 @@ /branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 /branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567 /branches/wlan-bringup:54809-54998 -/trunk/reactos:74526-74743 +/trunk/reactos:74526-74766 Modified: branches/setup_improvements/boot/bootdata/hivesys.inf URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/boot/bootdat…
============================================================================== --- branches/setup_improvements/boot/bootdata/hivesys.inf [iso-8859-1] (original) +++ branches/setup_improvements/boot/bootdata/hivesys.inf [iso-8859-1] Sat Jun 3 16:35:45 2017 @@ -338,6 +338,23 @@ HKLM,"SYSTEM\CurrentControlSet\Control\FileSystem","Win95TruncatedExtensions",0x00010001,1 ; Device classes (this list is incomplete... and should be generated from .inf files during installation) +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{36FC9E60-C465-11CF-8056-444553540000}",,0x00000000,"Universal Serial Bus controllers" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{36FC9E60-C465-11CF-8056-444553540000}","Class",0x00000000,"USB" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{36FC9E60-C465-11CF-8056-444553540000}","Icon",0x00000000,"-20" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{36FC9E60-C465-11CF-8056-444553540000}","NoInstallClass",0x00000000,"1" + +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E96B-E325-11CE-BFC1-08002BE10318}",,0x00000000,"Keyboard" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E96B-E325-11CE-BFC1-08002BE10318}","Class",0x00000000,"Keyboard" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E96B-E325-11CE-BFC1-08002BE10318}","Icon",0x00000000,"-3" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E96B-E325-11CE-BFC1-08002BE10318}","Installer32",0x00000000,"SysSetup.Dll,KeyboardClassInstaller" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E96B-E325-11CE-BFC1-08002BE10318}","NoInstallClass",0x00000000,"1" + +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}",,0x00000000,"Mouse" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}","Class",0x00000000,"Mouse" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}","Icon",0x00000000,"-2" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}","Installer32",0x00000000,"SysSetup.Dll,MouseClassInstaller" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}","NoInstallClass",0x00000000,"1" + HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E973-E325-11CE-BFC1-08002BE10318}",,0x00000000,"Network Client" HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E973-E325-11CE-BFC1-08002BE10318}","Class",0x00000000,"NetClient" HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E973-E325-11CE-BFC1-08002BE10318}","Icon",0x00000000,"-7" @@ -358,6 +375,10 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E975-E325-11CE-BFC1-08002BE10318}","Installer32",0x00000000,"NetCfgx.dll,NetClassInstaller" HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E975-E325-11CE-BFC1-08002BE10318}","NoDisplayClass",0x00000000,"1" HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E975-E325-11CE-BFC1-08002BE10318}","NoInstallClass",0x00000000,"1" + +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E97D-E325-11CE-BFC1-08002BE10318}",,0x00000000,"System Devices" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E97D-E325-11CE-BFC1-08002BE10318}","Class",0x00000000,"System" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E97D-E325-11CE-BFC1-08002BE10318}","Icon",0x00000000,"-27" HKLM,"SYSTEM\CurrentControlSet\Control\Class\{9D6D66A6-0B0C-4563-9077-A0E9A7955AE4}",,0x00000000,"Ramdisk" HKLM,"SYSTEM\CurrentControlSet\Control\Class\{9D6D66A6-0B0C-4563-9077-A0E9A7955AE4}","Class",0x00000000,"Ramdisk" Modified: branches/setup_improvements/dll/win32/kernel32/client/appcache.c URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/dll/win32/ke…
============================================================================== --- branches/setup_improvements/dll/win32/kernel32/client/appcache.c [iso-8859-1] (original) +++ branches/setup_improvements/dll/win32/kernel32/client/appcache.c [iso-8859-1] Sat Jun 3 16:35:45 2017 @@ -15,7 +15,7 @@ /* GLOBALS ********************************************************************/ -ULONG g_ShimsEnabled = -1; +ULONG g_ShimsDisabled = -1; static BOOL g_ApphelpInitialized = FALSE; static PVOID g_pApphelpCheckRunAppEx; static PVOID g_pSdbPackAppCompatData; @@ -54,8 +54,10 @@ * This is a TROOLEAN, -1 means we haven't yet figured it out. * 0 means shims are enabled, and 1 means shims are disabled! */ - if (g_ShimsEnabled == -1) - { + if (g_ShimsDisabled == -1) + { + ULONG DisableShims = FALSE; + /* Open the safe mode key */ Status = NtOpenKey(&KeyHandle, KEY_QUERY_VALUE, &OptionKeyAttributes); if (NT_SUCCESS(Status)) @@ -74,66 +76,63 @@ (KeyInfo.Data[0] == TRUE)) { /* It is, so disable shims! */ - g_ShimsEnabled = TRUE; + DisableShims = TRUE; } - else + } + + if (!DisableShims) + { + /* Open the app compatibility engine settings key */ + Status = NtOpenKey(&KeyHandle, KEY_QUERY_VALUE, &AppCompatKeyAttributes); + if (NT_SUCCESS(Status)) { - /* Open the app compatibility engine settings key */ - Status = NtOpenKey(&KeyHandle, KEY_QUERY_VALUE, &AppCompatKeyAttributes); - if (NT_SUCCESS(Status)) + /* Check if the app compat engine is turned off */ + Status = NtQueryValueKey(KeyHandle, + &DisableAppCompat, + KeyValuePartialInformation, + &KeyInfo, + sizeof(KeyInfo), + &ResultLength); + NtClose(KeyHandle); + if ((NT_SUCCESS(Status)) && + (KeyInfo.Type == REG_DWORD) && + (KeyInfo.DataLength == sizeof(ULONG)) && + (KeyInfo.Data[0] == TRUE)) { - /* Check if the app compat engine is turned off */ - Status = NtQueryValueKey(KeyHandle, - &DisableAppCompat, - KeyValuePartialInformation, - &KeyInfo, - sizeof(KeyInfo), - &ResultLength); - NtClose(KeyHandle); - if ((NT_SUCCESS(Status)) && - (KeyInfo.Type == REG_DWORD) && - (KeyInfo.DataLength == sizeof(ULONG)) && - (KeyInfo.Data[0] == TRUE)) - { - /* It is, so disable shims! */ - g_ShimsEnabled = TRUE; - } - else - { - /* Finally, open the app compatibility policy key */ - Status = NtOpenKey(&KeyHandle, KEY_QUERY_VALUE, &PolicyKeyAttributes); - if (NT_SUCCESS(Status)) - { - /* Check if the system policy disables app compat */ - Status = NtQueryValueKey(KeyHandle, - &DisableEngine, - KeyValuePartialInformation, - &KeyInfo, - sizeof(KeyInfo), - &ResultLength); - NtClose(KeyHandle); - if ((NT_SUCCESS(Status)) && - (KeyInfo.Type == REG_DWORD) && - (KeyInfo.DataLength == sizeof(ULONG)) && - (KeyInfo.Data[0] == TRUE)) - { - /* It does, so disable shims! */ - g_ShimsEnabled = TRUE; - } - else - { - /* No keys are set, so enable shims! */ - g_ShimsEnabled = FALSE; - } - } - } + /* It is, so disable shims! */ + DisableShims = TRUE; } } } + if (!DisableShims) + { + /* Finally, open the app compatibility policy key */ + Status = NtOpenKey(&KeyHandle, KEY_QUERY_VALUE, &PolicyKeyAttributes); + if (NT_SUCCESS(Status)) + { + /* Check if the system policy disables app compat */ + Status = NtQueryValueKey(KeyHandle, + &DisableEngine, + KeyValuePartialInformation, + &KeyInfo, + sizeof(KeyInfo), + &ResultLength); + NtClose(KeyHandle); + if ((NT_SUCCESS(Status)) && + (KeyInfo.Type == REG_DWORD) && + (KeyInfo.DataLength == sizeof(ULONG)) && + (KeyInfo.Data[0] == TRUE)) + { + /* It does, so disable shims! */ + DisableShims = TRUE; + } + } + } + g_ShimsDisabled = DisableShims; } /* Return if shims are disabled or not ("Enabled == 1" means disabled!) */ - return g_ShimsEnabled ? TRUE : FALSE; + return g_ShimsDisabled ? TRUE : FALSE; } /* Modified: branches/setup_improvements/dll/win32/mswsock/mswhelper.c URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/dll/win32/ms…
============================================================================== --- branches/setup_improvements/dll/win32/mswsock/mswhelper.c [iso-8859-1] (original) +++ branches/setup_improvements/dll/win32/mswsock/mswhelper.c [iso-8859-1] Sat Jun 3 16:35:45 2017 @@ -423,7 +423,7 @@ return NULL; } - ret = MultiByteToWideChar(1252, + ret = MultiByteToWideChar(CP_ACP, 0, aStr, aStrByteLen, @@ -464,7 +464,7 @@ return NULL; } - ret = WideCharToMultiByte(1252, + ret = WideCharToMultiByte(CP_ACP, 0, wStr, charLen, @@ -553,7 +553,7 @@ if (aCount >= MAX_ARRAY_SIZE) return NULL; - bItmLen = (strlen(*aSrcPtr) + 1) * sizeof(char); + bItmLen = strlen(*aSrcPtr) + 1; aStrByteLen[aCount] = bItmLen; bLen += sizeof(*aSrcPtr) + bItmLen; @@ -591,3 +591,93 @@ return resA; } + +char** +StrAryCpyHeapAllocWToA(_In_opt_ HANDLE hHeap, + _In_ WCHAR** wStrAry) +{ + WCHAR** wSrcPtr; + char** aDstPtr; + char* aDstNextStr; + DWORD aStrByteLen[MAX_ARRAY_SIZE]; + int bLen; + int bItmLen; + int aCount; + int i1; + char** resA; + int ret; + char* aStr; + + if (hHeap == 0) + hHeap = GetProcessHeap(); + + /* Calculating size of array ... */ + wSrcPtr = wStrAry; + bLen = 0; + aCount = 0; + + while (*wSrcPtr != NULL) + { + if (aCount >= MAX_ARRAY_SIZE) + return NULL; + + bItmLen = wcslen(*wSrcPtr) + 1; + aStrByteLen[aCount] = bItmLen; + + bLen += sizeof(*wSrcPtr) + bItmLen; + + wSrcPtr++; + aCount++; + } + + /* size for NULL-terminator */ + bLen += sizeof(*wSrcPtr); + + /* get memory */ + resA = HeapAlloc(hHeap, 0, bLen); + + /* copy data */ + wSrcPtr = wStrAry; + aDstPtr = resA; + + /* pos for the first string */ + aDstNextStr = (char*)(resA + aCount + 1); + for (i1 = 0; i1 < aCount; i1++) + { + bItmLen = aStrByteLen[i1]; + + *aDstPtr = aDstNextStr; + + aStr = HeapAlloc(hHeap, 0, bItmLen); + if (aStr == NULL) + { + HeapFree(hHeap, 0, aStr); + return NULL; + } + + ret = WideCharToMultiByte(CP_ACP, + 0, + *wSrcPtr, + bItmLen, + aStr, + bItmLen, + NULL, + NULL); + if (ret != bItmLen) + { + HeapFree(hHeap, 0, aStr); + return NULL; + } + RtlCopyMemory(*aDstPtr, aStr, bItmLen); + HeapFree(hHeap, 0, aStr); + + aDstNextStr = (char*)((DWORD)aDstNextStr + (DWORD)bItmLen); + aDstPtr++; + wSrcPtr++; + } + + /* terminate with NULL */ + *aDstPtr = NULL; + + return resA; +} Modified: branches/setup_improvements/dll/win32/mswsock/mswhelper.h URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/dll/win32/ms…
============================================================================== --- branches/setup_improvements/dll/win32/mswsock/mswhelper.h [iso-8859-1] (original) +++ branches/setup_improvements/dll/win32/mswsock/mswhelper.h [iso-8859-1] Sat Jun 3 16:35:45 2017 @@ -117,4 +117,13 @@ _In_opt_ HANDLE hHeap, _In_ char** aStrAry); +/* strary: + ptr1 ... ptrn \0 + data1 ... datan +*/ +char** +StrAryCpyHeapAllocWToA( + _In_opt_ HANDLE hHeap, + _In_ WCHAR** aStrAry); + #endif // _MSWHELPER_H Modified: branches/setup_improvements/dll/win32/mswsock/nsplookup.c URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/dll/win32/ms…
============================================================================== --- branches/setup_improvements/dll/win32/mswsock/nsplookup.c [iso-8859-1] (original) +++ branches/setup_improvements/dll/win32/mswsock/nsplookup.c [iso-8859-1] Sat Jun 3 16:35:45 2017 @@ -469,12 +469,14 @@ _Out_ PWSHOSTINFOINTERN hostinfo) { HANDLE hHeap = GetProcessHeap(); - DNS_STATUS dns_status = {0}; + DNS_STATUS dns_status = { 0 }; /* include/WinDNS.h -- look up DNS_RECORD on MSDN */ - PDNS_RECORD dp; - PDNS_RECORD curr; + PDNS_RECORDW dp; + PDNS_RECORDW curr; INT result = ERROR_SUCCESS; DWORD dwQueryFlags = DNS_QUERY_STANDARD; + PWCHAR Aliases[WS2_INTERNAL_MAX_ALIAS] = { 0 }; + int AliasIndex = 0; /* needed to be cleaned up if != NULL */ dp = NULL; @@ -492,13 +494,12 @@ /* DNS_TYPE_A: include/WinDNS.h */ /* DnsQuery -- lib/dnsapi/dnsapi/query.c */ - dns_status = DnsQuery(data->hostnameW, - DNS_TYPE_A, - dwQueryFlags, - /* extra dns servers */ 0, - &dp, - 0); - + dns_status = DnsQuery_W(data->hostnameW, + DNS_TYPE_A, + dwQueryFlags, + NULL /* extra dns servers */, + &dp, + NULL); if (dns_status == ERROR_INVALID_NAME) { WSASetLastError(WSAEFAULT); @@ -517,7 +518,10 @@ curr = dp; while ((curr->pNext != NULL) || (curr->wType != DNS_TYPE_A)) { - /* FIXME build aliases list */ + if (curr->wType == DNS_TYPE_CNAME) + { + Aliases[AliasIndex++] = curr->Data.Cname.pNameHost; + } curr = curr->pNext; } @@ -526,10 +530,12 @@ result = WSASERVICE_NOT_FOUND; goto cleanup; } - hostinfo->hostnameW = StrCpyHeapAllocW(hHeap, curr->pName); hostinfo->addr4 = curr->Data.A.IpAddress; - /* FIXME attach built aliases list */ + if (AliasIndex) + { + hostinfo->servaliasesA = StrAryCpyHeapAllocWToA(hHeap, (WCHAR**)&Aliases); + } result = ERROR_SUCCESS; cleanup: Modified: branches/setup_improvements/dll/win32/netapi32/netapi32.spec URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/dll/win32/ne…
============================================================================== --- branches/setup_improvements/dll/win32/netapi32/netapi32.spec [iso-8859-1] (original) +++ branches/setup_improvements/dll/win32/netapi32/netapi32.spec [iso-8859-1] Sat Jun 3 16:35:45 2017 @@ -225,13 +225,13 @@ @ stub NetSessionGetInfo @ stub NetSetPrimaryComputerName @ stdcall NetShareAdd(wstr long ptr ptr) -@ stub NetShareCheck +@ stdcall NetShareCheck(wstr wstr ptr) @ stdcall NetShareDel(wstr wstr long) -@ stub NetShareDelSticky +@ stdcall NetShareDelSticky(wstr wstr long) @ stdcall NetShareEnum(wstr long ptr long ptr ptr ptr) -@ stub NetShareEnumSticky +@ stdcall NetShareEnumSticky(wstr long ptr long ptr ptr ptr) @ stdcall NetShareGetInfo(wstr wstr long ptr) -@ stub NetShareSetInfo +@ stdcall NetShareSetInfo(wstr wstr long ptr ptr) @ stdcall NetStatisticsGet(wstr wstr long long ptr) @ stub NetUnjoinDomain @ stub NetUnregisterDomainNameChangeNotification Modified: branches/setup_improvements/dll/win32/netapi32/share.c URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/dll/win32/ne…
============================================================================== --- branches/setup_improvements/dll/win32/netapi32/share.c [iso-8859-1] (original) +++ branches/setup_improvements/dll/win32/netapi32/share.c [iso-8859-1] Sat Jun 3 16:35:45 2017 @@ -57,62 +57,6 @@ } /************************************************************ - * NetShareEnum (NETAPI32.@) - * - * PARAMS - * servername [I] Pointer to a string with the name of the server - * level [I] Data information level - * bufptr [O] Buffer to the data - * prefmaxlen [I] Preferred maximum length of the data - * entriesread [O] Pointer to the number of entries enumerated - * totalentries [O] Pointer to the possible number of entries - * resume_handle [I/O] Pointer to a handle for subsequent searches - * - * RETURNS - * If successful, the function returns NERR_Success - * On failure it returns a system error code (FIXME: find out which) - * - */ -NET_API_STATUS WINAPI NetShareEnum( LMSTR servername, DWORD level, LPBYTE* bufptr, - DWORD prefmaxlen, LPDWORD entriesread, LPDWORD totalentries, LPDWORD resume_handle) -{ - FIXME("Stub (%s %d %p %d %p %p %p)\n", debugstr_w(servername), level, bufptr, - prefmaxlen, entriesread, totalentries, resume_handle); - - return ERROR_NOT_SUPPORTED; -} - -/************************************************************ - * NetShareDel (NETAPI32.@) - */ -NET_API_STATUS WINAPI NetShareDel(LMSTR servername, LMSTR netname, DWORD reserved) -{ - FIXME("Stub (%s %s %d)\n", debugstr_w(servername), debugstr_w(netname), reserved); - return NERR_Success; -} - -/************************************************************ - * NetShareGetInfo (NETAPI32.@) - */ -NET_API_STATUS WINAPI NetShareGetInfo(LMSTR servername, LMSTR netname, - DWORD level, LPBYTE *bufptr) -{ - FIXME("Stub (%s %s %d %p)\n", debugstr_w(servername), - debugstr_w(netname),level, bufptr); - return NERR_NetNameNotFound; -} - -/************************************************************ - * NetShareAdd (NETAPI32.@) - */ -NET_API_STATUS WINAPI NetShareAdd(LMSTR servername, - DWORD level, LPBYTE buf, LPDWORD parm_err) -{ - FIXME("Stub (%s %d %p %p)\n", debugstr_w(servername), level, buf, parm_err); - return ERROR_NOT_SUPPORTED; -} - -/************************************************************ * NetFileEnum (NETAPI32.@) */ NET_API_STATUS WINAPI NetFileEnum( Modified: branches/setup_improvements/dll/win32/netapi32/srvsvc.c URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/dll/win32/ne…
============================================================================== --- branches/setup_improvements/dll/win32/netapi32/srvsvc.c [iso-8859-1] (original) +++ branches/setup_improvements/dll/win32/netapi32/srvsvc.c [iso-8859-1] Sat Jun 3 16:35:45 2017 @@ -1,10 +1,9 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: NetAPI DLL - * FILE: reactos/dll/win32/netapi32/schedule.c + * FILE: reactos/dll/win32/netapi32/srvsvc.c * PURPOSE: Server service interface code - * - * PROGRAMMERS: Eric Kohl + * PROGRAMMERS: Eric Kohl <eric.kohl(a)reactos.org> */ /* INCLUDES ******************************************************************/ @@ -74,8 +73,8 @@ NET_API_STATUS WINAPI NetRemoteTOD( - LPCWSTR UncServerName, - LPBYTE *BufferPtr) + _In_ LPCWSTR UncServerName, + _Out_ LPBYTE *BufferPtr) { NET_API_STATUS status; @@ -98,4 +97,406 @@ return status; } + +NET_API_STATUS +WINAPI +NetShareAdd( + _In_ LMSTR servername, + _In_ DWORD level, + _In_ LPBYTE buf, + _Out_ LPDWORD parm_err) +{ + NET_API_STATUS status; + + TRACE("NetShareAdd(%s %lu %p %p)\n", + debugstr_w(servername), level, buf, parm_err); + + if (level != 2 && level != 502 && level != 503) + return ERROR_INVALID_LEVEL; + + RpcTryExcept + { + status = NetrShareAdd(servername, + level, + (LPSHARE_INFO)&buf, + parm_err); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; +} + + +NET_API_STATUS +WINAPI +NetShareCheck( + _In_ LMSTR servername, + _In_ LMSTR device, + _Out_ LPDWORD type) +{ + NET_API_STATUS status; + + TRACE("NetShareCheck(%s %s %p)\n", + debugstr_w(servername), debugstr_w(device), type); + + RpcTryExcept + { + status = NetrShareCheck(servername, + device, + type); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; + +} + + +NET_API_STATUS +WINAPI +NetShareDel( + _In_ LMSTR servername, + _In_ LMSTR netname, + _In_ DWORD reserved) +{ + NET_API_STATUS status; + + TRACE("NetShareDel(%s %s %lu)\n", + debugstr_w(servername), debugstr_w(netname), reserved); + + if (netname == NULL || (*netname == 0) || reserved != 0) + return ERROR_INVALID_PARAMETER; + + RpcTryExcept + { + status = NetrShareDel(servername, + netname, + reserved); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; +} + + +NET_API_STATUS +WINAPI +NetShareDelSticky( + _In_ LMSTR servername, + _In_ LMSTR netname, + _In_ DWORD reserved) +{ + NET_API_STATUS status; + + TRACE("NetShareDelSticky(%s %s %lu)\n", + debugstr_w(servername), debugstr_w(netname), reserved); + + if (netname == NULL || (*netname == 0) || reserved != 0) + return ERROR_INVALID_PARAMETER; + + RpcTryExcept + { + status = NetrShareDelSticky(servername, + netname, + reserved); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; +} + + +NET_API_STATUS +WINAPI +NetShareEnum( + _In_ LMSTR servername, + _In_ DWORD level, + _Out_ LPBYTE *bufptr, + _In_ DWORD prefmaxlen, + _Out_ LPDWORD entriesread, + _Out_ LPDWORD totalentries, + _Inout_ LPDWORD resume_handle) +{ + SHARE_ENUM_STRUCT EnumStruct; + SHARE_INFO_0_CONTAINER Level0Container = {0, NULL}; + SHARE_INFO_1_CONTAINER Level1Container = {0, NULL}; + SHARE_INFO_2_CONTAINER Level2Container = {0, NULL}; + SHARE_INFO_502_CONTAINER Level502Container = {0, NULL}; + NET_API_STATUS status; + + TRACE("NetShareEnum(%s %lu %p %lu %p %p %p)\n", + debugstr_w(servername), level, bufptr, prefmaxlen, + entriesread, totalentries, resume_handle); + + if (level > 2 && level != 502) + return ERROR_INVALID_LEVEL; + + *bufptr = NULL; + *entriesread = 0; + *totalentries = 0; + + EnumStruct.Level = level; + switch (level) + { + case 0: + EnumStruct.ShareInfo.Level0 = &Level0Container; + break; + + case 1: + EnumStruct.ShareInfo.Level1 = &Level1Container; + break; + + case 2: + EnumStruct.ShareInfo.Level2 = &Level2Container; + break; + + case 502: + EnumStruct.ShareInfo.Level502 = &Level502Container; + break; + } + + RpcTryExcept + { + status = NetrShareEnum(servername, + &EnumStruct, + prefmaxlen, + totalentries, + resume_handle); + + switch (level) + { + case 0: + if (EnumStruct.ShareInfo.Level0->Buffer != NULL) + { + *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level0->Buffer; + *entriesread = EnumStruct.ShareInfo.Level0->EntriesRead; + } + break; + + case 1: + if (EnumStruct.ShareInfo.Level1->Buffer != NULL) + { + *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level1->Buffer; + *entriesread = EnumStruct.ShareInfo.Level1->EntriesRead; + } + break; + + case 2: + if (EnumStruct.ShareInfo.Level2->Buffer != NULL) + { + *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level2->Buffer; + *entriesread = EnumStruct.ShareInfo.Level2->EntriesRead; + } + break; + + case 502: + if (EnumStruct.ShareInfo.Level502->Buffer != NULL) + { + *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level502->Buffer; + *entriesread = EnumStruct.ShareInfo.Level502->EntriesRead; + } + break; + } + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; +} + + +NET_API_STATUS +WINAPI +NetShareEnumSticky( + _In_ LMSTR servername, + _In_ DWORD level, + _Out_ LPBYTE *bufptr, + _In_ DWORD prefmaxlen, + _Out_ LPDWORD entriesread, + _Out_ LPDWORD totalentries, + _Inout_ LPDWORD resume_handle) +{ + SHARE_ENUM_STRUCT EnumStruct; + SHARE_INFO_0_CONTAINER Level0Container = {0, NULL}; + SHARE_INFO_1_CONTAINER Level1Container = {0, NULL}; + SHARE_INFO_2_CONTAINER Level2Container = {0, NULL}; + SHARE_INFO_502_CONTAINER Level502Container = {0, NULL}; + NET_API_STATUS status; + + TRACE("NetShareEnumSticky(%s %lu %p %lu %p %p %p)\n", + debugstr_w(servername), level, bufptr, prefmaxlen, + entriesread, totalentries, resume_handle); + + if (level > 2 && level != 502) + return ERROR_INVALID_LEVEL; + + *bufptr = NULL; + *entriesread = 0; + *totalentries = 0; + + EnumStruct.Level = level; + switch (level) + { + case 0: + EnumStruct.ShareInfo.Level0 = &Level0Container; + break; + + case 1: + EnumStruct.ShareInfo.Level1 = &Level1Container; + break; + + case 2: + EnumStruct.ShareInfo.Level2 = &Level2Container; + break; + + case 502: + EnumStruct.ShareInfo.Level502 = &Level502Container; + break; + } + + RpcTryExcept + { + status = NetrShareEnum(servername, + (LPSHARE_ENUM_STRUCT)&EnumStruct, + prefmaxlen, + totalentries, + resume_handle); + + switch (level) + { + case 0: + if (EnumStruct.ShareInfo.Level0->Buffer != NULL) + { + *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level0->Buffer; + *entriesread = EnumStruct.ShareInfo.Level0->EntriesRead; + } + break; + + case 1: + if (EnumStruct.ShareInfo.Level1->Buffer != NULL) + { + *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level1->Buffer; + *entriesread = EnumStruct.ShareInfo.Level1->EntriesRead; + } + break; + + case 2: + if (EnumStruct.ShareInfo.Level2->Buffer != NULL) + { + *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level2->Buffer; + *entriesread = EnumStruct.ShareInfo.Level2->EntriesRead; + } + break; + + case 502: + if (EnumStruct.ShareInfo.Level502->Buffer != NULL) + { + *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level502->Buffer; + *entriesread = EnumStruct.ShareInfo.Level502->EntriesRead; + } + break; + } + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; +} + + +NET_API_STATUS +WINAPI +NetShareGetInfo( + _In_ LMSTR servername, + _In_ LMSTR netname, + _In_ DWORD level, + _Out_ LPBYTE *bufptr) +{ + NET_API_STATUS status; + + TRACE("NetShareGetInfo(%s %s %lu %p)\n", + debugstr_w(servername), debugstr_w(netname), level, bufptr); + + if (level > 2 && level != 502 && level != 1005) + return ERROR_INVALID_LEVEL; + + if (netname == NULL || *netname == 0) + return ERROR_INVALID_PARAMETER; + + *bufptr = NULL; + + RpcTryExcept + { + status = NetrShareGetInfo(servername, + netname, + level, + (LPSHARE_INFO)bufptr); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; +} + + +NET_API_STATUS +WINAPI +NetShareSetInfo( + _In_ LPWSTR servername, + _In_ LPWSTR netname, + _In_ DWORD level, + _In_ LPBYTE buf, + _Out_ LPDWORD parm_err) +{ + NET_API_STATUS status; + + TRACE("NetShareSetInfo(%s %s %lu %p %p)\n", + debugstr_w(servername), debugstr_w(netname), level, buf, parm_err); + + if (level != 2 && level != 502 && level != 503 && level != 1004 && + level != 1005 && level != 1006 && level != 1501) + return ERROR_INVALID_LEVEL; + + RpcTryExcept + { + status = NetrShareSetInfo(servername, + netname, + level, + (LPSHARE_INFO)&buf, + parm_err); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; +} + /* EOF */ Modified: branches/setup_improvements/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/dll/win32/sh…
============================================================================== --- branches/setup_improvements/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp [iso-8859-1] (original) +++ branches/setup_improvements/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp [iso-8859-1] Sat Jun 3 16:35:45 2017 @@ -839,6 +839,12 @@ return 0; } +LRESULT CMenuDeskBar::_OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) +{ + /* Prevent the CMenuDeskBar from destroying on being sent a WM_CLOSE */ + return 0; +} + HRESULT CMenuDeskBar::_AdjustForTheme(BOOL bFlatStyle) { DWORD style = bFlatStyle ? WS_BORDER : WS_CLIPCHILDREN|WS_DLGFRAME; Modified: branches/setup_improvements/dll/win32/shell32/shellmenu/CMenuDeskBar.h URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/dll/win32/sh…
============================================================================== --- branches/setup_improvements/dll/win32/shell32/shellmenu/CMenuDeskBar.h [iso-8859-1] (original) +++ branches/setup_improvements/dll/win32/shell32/shellmenu/CMenuDeskBar.h [iso-8859-1] Sat Jun 3 16:35:45 2017 @@ -74,6 +74,7 @@ MESSAGE_HANDLER(WM_MOUSEACTIVATE, _OnMouseActivate) MESSAGE_HANDLER(WM_WININICHANGE , _OnWinIniChange) MESSAGE_HANDLER(WM_NCPAINT, _OnNcPaint) + MESSAGE_HANDLER(WM_CLOSE, _OnClose) END_MSG_MAP() BEGIN_COM_MAP(CMenuDeskBar) @@ -142,6 +143,7 @@ LRESULT _OnAppActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled); LRESULT _OnWinIniChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled); LRESULT _OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled); + LRESULT _OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled); HRESULT _AdjustForTheme(BOOL bFlatStyle); BOOL _IsSubMenuParent(HWND hwnd); Modified: branches/setup_improvements/sdk/include/psdk/asptlb.idl URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/sdk/include/…
============================================================================== --- branches/setup_improvements/sdk/include/psdk/asptlb.idl [iso-8859-1] (original) +++ branches/setup_improvements/sdk/include/psdk/asptlb.idl [iso-8859-1] Sat Jun 3 16:35:45 2017 @@ -23,22 +23,21 @@ [ object, dual, - uuid(D97A6DA0-A85F-11df-83AE-00A0C90C2BD8) + uuid(D97A6DA0-A864-11cf-83BE-00A0C90C2BD8) ] interface IRequestDictionary : IDispatch { [propget] - HRESULT Item(IRequestDictionary *iface, [in, optional] VARIANT Var, - [retval, out] VARIANT *pVariantReturn); + HRESULT Item([in, optional] VARIANT Var, [retval, out] VARIANT *pVariantReturn); [restricted, propget] - HRESULT _NewEnum(IRequestDictionary *iface, [retval, out] IUnknown **ppEnumReturn); + HRESULT _NewEnum([retval, out] IUnknown **ppEnumReturn); [propget] - HRESULT Count(IRequestDictionary *iface, [retval, out] int *cStrRet); + HRESULT Count([retval, out] int *count); [propget] - HRESULT Key(IRequestDictionary *iface, [in] VARIANT VarKey, [retval, out]VARIANT *pvar); + HRESULT Key([in] VARIANT key, [retval, out] VARIANT *value); }; [ @@ -49,85 +48,85 @@ interface IResponse : IDispatch { [propget] - HRESULT Buffer(IResponse *iface, [retval, out] VARIANT_BOOL *fIsBuffering); + HRESULT Buffer([retval, out] VARIANT_BOOL *is_buffering); [propput] - HRESULT Buffer(IResponse *iface, [in] VARIANT_BOOL fIsBuffering); + HRESULT Buffer([in] VARIANT_BOOL is_buffering); [propget] - HRESULT ContentType(IResponse *iface, [retval, out] BSTR *pbstrContentTypeRet); + HRESULT ContentType([retval, out] BSTR *content_type); [propput] - HRESULT ContentType(IResponse *iface, [in] BSTR bstrContentType); + HRESULT ContentType([in] BSTR content_type); [propget] - HRESULT Expires(IResponse *iface, [retval, out] VARIANT *pvarExpiresMinutesRet); + HRESULT Expires([retval, out] VARIANT *minutes); [propput] - HRESULT Expires(IResponse *iface, [in] long lExpiresMinutes); + HRESULT Expires([in] LONG minutes); [propget] - HRESULT ExpiresAbsolute(IResponse *iface, [retval, out] VARIANT *pvarExpiresRet); + HRESULT ExpiresAbsolute([retval, out] VARIANT *expires); [propput] - HRESULT ExpiresAbsolute(IResponse *iface, [in] DATE dtExpires); + HRESULT ExpiresAbsolute([in] DATE expires); [propget] - HRESULT Cookies(IResponse *iface, [retval, out] IRequestDictionary **ppCookies); + HRESULT Cookies([retval, out] IRequestDictionary **cookies); [propget] - HRESULT Status(IResponse *iface, [retval][out] BSTR *pbstrStatusRet); + HRESULT Status([retval, out] BSTR *status); [propput] - HRESULT Status(IResponse *iface, [in] BSTR bstrStatus); + HRESULT Status([in] BSTR status); [hidden] - HRESULT Add(IResponse *iface, [in] BSTR bstrHeaderValue, [in] BSTR bstrHeaderName); + HRESULT Add([in] BSTR value, [in] BSTR name); - HRESULT AddHeader(IResponse *iface, [in] BSTR bstrHeaderName, [in] BSTR bstrHeaderValue); + HRESULT AddHeader([in] BSTR name, [in] BSTR value); - HRESULT AppendToLog(IResponse *iface, [in] BSTR bstrLogEntry); + HRESULT AppendToLog([in] BSTR log_entry); - HRESULT BinaryWrite(IResponse *iface, [in] VARIANT varInput); + HRESULT BinaryWrite([in] VARIANT input); - HRESULT Clear(IResponse *iface); + HRESULT Clear(); - HRESULT End(IResponse *iface); + HRESULT End(); - HRESULT Flush(IResponse *iface); + HRESULT Flush(); - HRESULT Redirect(IResponse *iface, [in] BSTR bstrURL); + HRESULT Redirect(BSTR url); - HRESULT Write(IResponse *iface, [in] VARIANT varText); + HRESULT Write([in] VARIANT text); [hidden] - HRESULT WriteBlock(IResponse *iface, [in] short iBlockNumber); + HRESULT WriteBlock([in] short block_number); - HRESULT IsClientConnected(IResponse *iface, [retval, out] VARIANT_BOOL *pfIsClientConnected); + HRESULT IsClientConnected([retval, out] VARIANT_BOOL *is_connected); [propget] - HRESULT get_CharSet( IResponse *iface, [retval, out] BSTR *pbstrCharSetRet); + HRESULT CharSet([retval, out] BSTR *charset); [propput] - HRESULT put_CharSet(IResponse *iface, [in] BSTR bstrCharSet); + HRESULT CharSet([in] BSTR charset); - HRESULT Pics(IResponse *iface, [in] BSTR bstrHeaderValue); + HRESULT Pics([in] BSTR value); [propget] - HRESULT get_CacheControl(IResponse *iface, [retval, out] BSTR *pbstrCacheControl); + HRESULT CacheControl([retval, out] BSTR *cache_control); [propput] - HRESULT put_CacheControl(IResponse *iface, [in] BSTR bstrCacheControl); + HRESULT CacheControl([in] BSTR cache_control); [propget] - HRESULT get_CodePage(IResponse *iface, [retval, out] long *plvar); + HRESULT CodePage([retval, out] LONG *codepage); [propput] - HRESULT put_CodePage(IResponse *iface, [in] long lvar); + HRESULT CodePage([in] LONG codepage); [propget] - HRESULT get_LCID(IResponse *iface, [retval, out] long *plvar); + HRESULT LCID([retval, out] LONG *lcid); [propput] - HRESULT put_LCID(IResponse *iface, [in] long lvar); -}; + HRESULT LCID([in] LONG lcid); +} Modified: branches/setup_improvements/win32ss/printing/providers/localspl/printers.c URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/win32ss/prin…
============================================================================== --- branches/setup_improvements/win32ss/printing/providers/localspl/printers.c [iso-8859-1] (original) +++ branches/setup_improvements/win32ss/printing/providers/localspl/printers.c [iso-8859-1] Sat Jun 3 16:35:45 2017 @@ -756,7 +756,7 @@ size_t cbPrinterName; size_t cbPortName; PWSTR p; - PWSTR pwszStrings[1]; + PWSTR pwszStrings[2]; // Calculate the string lengths. cbPrinterName = (cchComputerName + wcslen(pPrinter->pwszPrinterName) + 1) * sizeof(WCHAR);
7 years, 6 months
1
0
0
0
[hbelusca] 74766: [USETUP]: Implement offline ReactOS registry initialization in USetup (equivalent of mkhive, but using OS functionality). The rationale is as follows. We now have the 1st-stage Re...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sat Jun 3 16:22:42 2017 New Revision: 74766 URL:
http://svn.reactos.org/svn/reactos?rev=74766&view=rev
Log: [USETUP]: Implement offline ReactOS registry initialization in USetup (equivalent of mkhive, but using OS functionality). The rationale is as follows. We now have the 1st-stage ReactOS setup running with its own registry SYSTEM hive, similarly to regular ROS running instances (livecd, regular installation...). The ReactOS-specific SetInstallPathValue() hack, introduced in r3794 and r3795, is removed. This hack told the kernel that, during the setup, it should "switch" the used registry hives and instead use the ones of the ROS installation being prepared. This was really hackish because this means, mixing between registry settings used only for the setup running instance, that could use different registry settings than the ones that should be set for the ROS installation being actually performed. Also, note that in the case of a 1st-stage GUI setup, consisting in running the LiveCD + the GUI setup program, this situation would be untenable. Note also that for people willing to use the Setup*** functions exported by setupapi.dll to parse the registry INF files to initialize the registry of the ROS installation being prepared, this would be impossible either. Hence the need to have offline registry modification functionality. Modified: branches/setup_improvements/base/setup/usetup/interface/usetup.c branches/setup_improvements/base/setup/usetup/mui.c branches/setup_improvements/base/setup/usetup/registry.c branches/setup_improvements/base/setup/usetup/registry.h branches/setup_improvements/base/setup/usetup/settings.c Modified: branches/setup_improvements/base/setup/usetup/interface/usetup.c URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
============================================================================== --- branches/setup_improvements/base/setup/usetup/interface/usetup.c [iso-8859-1] (original) +++ branches/setup_improvements/base/setup/usetup/interface/usetup.c [iso-8859-1] Sat Jun 3 16:22:42 2017 @@ -815,9 +815,9 @@ MUIDisplayError(ERROR_NO_SOURCE_DRIVE, Ir, POPUP_WAIT_ENTER); return QUIT_PAGE; } - DPRINT1("SourcePath: '%wZ'", &SourcePath); - DPRINT1("SourceRootPath: '%wZ'", &SourceRootPath); - DPRINT1("SourceRootDir: '%wZ'", &SourceRootDir); + DPRINT1("SourcePath: '%wZ'\n", &SourcePath); + DPRINT1("SourceRootPath: '%wZ'\n", &SourceRootPath); + DPRINT1("SourceRootDir: '%wZ'\n", &SourceRootDir); /* Load txtsetup.sif from install media. */ CombinePaths(FileNameBuffer, ARRAYSIZE(FileNameBuffer), 2, SourcePath.Buffer, L"txtsetup.sif"); @@ -4042,8 +4042,7 @@ * QuitPage * * SIDEEFFECTS - * Calls SetInstallPathValue - * Calls NtInitializeRegistry + * Calls RegInitializeRegistry * Calls ImportRegistryFile * Calls SetDefaultPagefile * Calls SetMountedDeviceValues @@ -4070,21 +4069,23 @@ return SUCCESS_PAGE; } - /************************ HACK!!!!!!!!!!! *********************************/ - if (!SetInstallPathValue(&DestinationPath)) - { - DPRINT1("SetInstallPathValue() failed\n"); - MUIDisplayError(ERROR_INITIALIZE_REGISTRY, Ir, POPUP_WAIT_ENTER); - return QUIT_PAGE; - } - /************************ HACK!!!!!!!!!!! *********************************/ - - /* Create the default hives */ - Status = NtInitializeRegistry(CM_BOOT_FLAG_SETUP); + /* Initialize the registry and setup the default installation hives */ + Status = RegInitializeRegistry(&DestinationPath); if (!NT_SUCCESS(Status)) { - DPRINT1("NtInitializeRegistry() failed (Status %lx)\n", Status); - MUIDisplayError(ERROR_CREATE_HIVE, Ir, POPUP_WAIT_ENTER); + DPRINT1("RegInitializeRegistry() failed\n"); + /********** HACK!!!!!!!!!!! **********/ + if (Status == STATUS_NOT_IMPLEMENTED) + { + /* The hack was called, display its corresponding error */ + MUIDisplayError(ERROR_INITIALIZE_REGISTRY, Ir, POPUP_WAIT_ENTER); + } + else + /*************************************/ + { + /* Something else (correct) failed */ + MUIDisplayError(ERROR_CREATE_HIVE, Ir, POPUP_WAIT_ENTER); + } return QUIT_PAGE; } @@ -4094,6 +4095,7 @@ if (!SetupFindFirstLineW(SetupInf, L"HiveInfs.Install", NULL, &InfContext)) { DPRINT1("SetupFindFirstLine() failed\n"); + RegCleanupRegistry(); MUIDisplayError(ERROR_FIND_REGISTRY, Ir, POPUP_WAIT_ENTER); return QUIT_PAGE; } @@ -4128,6 +4130,7 @@ { DPRINT1("Importing %S failed\n", File); + RegCleanupRegistry(); MUIDisplayError(ERROR_IMPORT_HIVE, Ir, POPUP_WAIT_ENTER); return QUIT_PAGE; } @@ -4137,6 +4140,7 @@ CONSOLE_SetStatusText(MUIGetString(STRING_DISPLAYETTINGSUPDATE)); if (!ProcessDisplayRegistry(SetupInf, DisplayList)) { + RegCleanupRegistry(); MUIDisplayError(ERROR_UPDATE_DISPLAY_SETTINGS, Ir, POPUP_WAIT_ENTER); return QUIT_PAGE; } @@ -4145,6 +4149,7 @@ CONSOLE_SetStatusText(MUIGetString(STRING_LOCALESETTINGSUPDATE)); if (!ProcessLocaleRegistry(LanguageList)) { + RegCleanupRegistry(); MUIDisplayError(ERROR_UPDATE_LOCALESETTINGS, Ir, POPUP_WAIT_ENTER); return QUIT_PAGE; } @@ -4153,6 +4158,7 @@ CONSOLE_SetStatusText(MUIGetString(STRING_ADDKBLAYOUTS)); if (!AddKeyboardLayouts()) { + RegCleanupRegistry(); MUIDisplayError(ERROR_ADDING_KBLAYOUTS, Ir, POPUP_WAIT_ENTER); return QUIT_PAGE; } @@ -4160,6 +4166,7 @@ /* Set GeoID */ if (!SetGeoID(MUIGetGeoID())) { + RegCleanupRegistry(); MUIDisplayError(ERROR_UPDATE_GEOID, Ir, POPUP_WAIT_ENTER); return QUIT_PAGE; } @@ -4170,6 +4177,7 @@ CONSOLE_SetStatusText(MUIGetString(STRING_KEYBOARDSETTINGSUPDATE)); if (!ProcessKeyboardLayoutRegistry(LayoutList)) { + RegCleanupRegistry(); MUIDisplayError(ERROR_UPDATE_KBSETTINGS, Ir, POPUP_WAIT_ENTER); return QUIT_PAGE; } @@ -4179,6 +4187,7 @@ CONSOLE_SetStatusText(MUIGetString(STRING_CODEPAGEINFOUPDATE)); if (!AddCodePage()) { + RegCleanupRegistry(); MUIDisplayError(ERROR_ADDING_CODEPAGE, Ir, POPUP_WAIT_ENTER); return QUIT_PAGE; } @@ -4188,6 +4197,12 @@ /* Update the mounted devices list */ SetMountedDeviceValues(PartitionList); + + // + // TODO: Unload all the registry stuff, perform cleanup, + // and copy the created hive files into .sav ones. + // + RegCleanupRegistry(); CONSOLE_SetStatusText(MUIGetString(STRING_DONE)); @@ -4207,8 +4222,7 @@ * QuitPage * * SIDEEFFECTS - * Calls SetInstallPathValue - * Calls NtInitializeRegistry + * Calls RegInitializeRegistry * Calls ImportRegistryFile * Calls SetDefaultPagefile * Calls SetMountedDeviceValues @@ -4683,6 +4697,9 @@ LARGE_INTEGER Time; NTSTATUS Status; BOOLEAN Old; + + /* Tell the Cm this is a setup boot, and it has to behave accordingly */ + NtInitializeRegistry(CM_BOOT_FLAG_SETUP); NtQuerySystemTime(&Time); Modified: branches/setup_improvements/base/setup/usetup/mui.c URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
============================================================================== --- branches/setup_improvements/base/setup/usetup/mui.c [iso-8859-1] (original) +++ branches/setup_improvements/base/setup/usetup/mui.c [iso-8859-1] Sat Jun 3 16:22:42 2017 @@ -297,11 +297,11 @@ NTSTATUS Status; RtlInitUnicodeString(&KeyName, - L"\\Registry\\User\\.DEFAULT\\Keyboard Layout\\Toggle"); + L".DEFAULT\\Keyboard Layout\\Toggle"); InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, - NULL, + GetRootKeyByPredefKey(HKEY_USERS, NULL), NULL); Status = NtCreateKey(&KeyHandle, @@ -384,17 +384,16 @@ ULONG Disposition; ULONG uIndex = 0; ULONG uCount = 0; - WCHAR szKeyName[48] = L"\\Registry\\User\\.DEFAULT\\Keyboard Layout"; + WCHAR szKeyName[48] = L".DEFAULT\\Keyboard Layout"; WCHAR szValueName[3 + 1]; WCHAR szLangID[8 + 1]; // Open the keyboard layout key - RtlInitUnicodeString(&KeyName, - szKeyName); + RtlInitUnicodeString(&KeyName, szKeyName); InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, - NULL, + GetRootKeyByPredefKey(HKEY_USERS, NULL), NULL); Status = NtCreateKey(&KeyHandle, @@ -416,7 +415,7 @@ KeyName.MaximumLength = sizeof(szKeyName); Status = RtlAppendUnicodeToString(&KeyName, L"\\Preload"); - if(!NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) { DPRINT1("RtlAppend failed! (%lx)\n", Status); DPRINT1("String is %wZ\n", &KeyName); @@ -426,7 +425,7 @@ InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, - NULL, + GetRootKeyByPredefKey(HKEY_USERS, NULL), NULL); Status = NtCreateKey(&KeyHandle, @@ -443,11 +442,11 @@ return FALSE; } - RtlInitUnicodeString(&KeyName, L"\\Registry\\User\\.DEFAULT\\Keyboard Layout\\Substitutes"); + RtlInitUnicodeString(&KeyName, L".DEFAULT\\Keyboard Layout\\Substitutes"); InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, - NULL, + GetRootKeyByPredefKey(HKEY_USERS, NULL), NULL); Status = NtCreateKey(&SubKeyHandle, @@ -577,15 +576,15 @@ // Open the nls codepage key RtlInitUnicodeString(&KeyName, - L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\CodePage"); + L"SYSTEM\\CurrentControlSet\\Control\\NLS\\CodePage"); InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, - NULL, + GetRootKeyByPredefKey(HKEY_LOCAL_MACHINE, NULL), NULL); - Status = NtOpenKey(&KeyHandle, - KEY_WRITE, - &ObjectAttributes); + Status = NtOpenKey(&KeyHandle, + KEY_WRITE, + &ObjectAttributes); if (!NT_SUCCESS(Status)) { DPRINT1("NtOpenKey() failed (Status %lx)\n", Status); @@ -656,15 +655,15 @@ ULONG uIndex = 0; RtlInitUnicodeString(&KeyName, - L"\\Registry\\Machine\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes"); + L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes"); InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, - NULL, + GetRootKeyByPredefKey(HKEY_LOCAL_MACHINE, NULL), NULL); - Status = NtOpenKey(&KeyHandle, - KEY_WRITE, - &ObjectAttributes); + Status = NtOpenKey(&KeyHandle, + KEY_WRITE, + &ObjectAttributes); if (!NT_SUCCESS(Status)) { DPRINT1("NtOpenKey() failed (Status %lx)\n", Status); Modified: branches/setup_improvements/base/setup/usetup/registry.c URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
============================================================================== --- branches/setup_improvements/base/setup/usetup/registry.c [iso-8859-1] (original) +++ branches/setup_improvements/base/setup/usetup/registry.c [iso-8859-1] Sat Jun 3 16:22:42 2017 @@ -61,41 +61,66 @@ /* FUNCTIONS ****************************************************************/ -static -BOOLEAN -GetRootKey( - PWCHAR Name) -{ - if (!_wcsicmp (Name, L"HKCR")) - { - wcscpy (Name, L"\\Registry\\Machine\\SOFTWARE\\Classes\\"); - return TRUE; - } - - if (!_wcsicmp (Name, L"HKCU")) - { - wcscpy (Name, L"\\Registry\\User\\.DEFAULT\\"); - return TRUE; - } - - if (!_wcsicmp (Name, L"HKLM")) - { - wcscpy (Name, L"\\Registry\\Machine\\"); - return TRUE; - } - - if (!_wcsicmp (Name, L"HKU")) - { - wcscpy (Name, L"\\Registry\\User\\"); - return TRUE; - } - +typedef struct _ROOT_KEY +{ + PCWSTR Name; + PCWSTR MountPoint; + HANDLE Handle; +} ROOT_KEY, *PROOT_KEY; + +ROOT_KEY RootKeys[] = +{ + // L"\\Registry\\Machine\\SYSTEM\\USetup_Machine\\SOFTWARE\\Classes\\" + { L"HKCR", L"\\Registry\\Machine\\USetup_SOFTWARE\\Classes\\", NULL }, /* "\\Registry\\Machine\\SOFTWARE\\Classes\\" */ // HKEY_CLASSES_ROOT + { L"HKCU", L"\\Registry\\User\\USetup_DEFAULT\\" , NULL }, /* "\\Registry\\User\\.DEFAULT\\" */ // HKEY_CURRENT_USER + { L"HKLM", L"\\Registry\\Machine\\SYSTEM\\USetup_Machine\\" , NULL }, /* "\\Registry\\Machine\\" */ // HKEY_LOCAL_MACHINE + { L"HKU" , L"\\Registry\\Machine\\SYSTEM\\USetup_User\\" , NULL }, /* "\\Registry\\User\\" */ // HKEY_USERS #if 0 - if (!_wcsicmp (Name, L"HKR")) - return FALSE; -#endif - - return FALSE; + { L"HKR", NULL, NULL }, +#endif +}; + +#define IsPredefKey(HKey) \ + (((ULONG_PTR)(HKey) & 0xF0000000) == 0x80000000) + +#define GetPredefKeyIndex(HKey) \ + ((ULONG_PTR)(HKey) & 0x0FFFFFFF) + +HANDLE +GetRootKeyByPredefKey( + IN HANDLE KeyHandle, + OUT PCWSTR* RootKeyMountPoint OPTIONAL) +{ + ULONG_PTR Index = GetPredefKeyIndex(KeyHandle); + + if (!IsPredefKey(KeyHandle)) + return NULL; + if (GetPredefKeyIndex(KeyHandle) >= ARRAYSIZE(RootKeys)) + return NULL; + + if (RootKeyMountPoint) + *RootKeyMountPoint = RootKeys[Index].MountPoint; + return RootKeys[Index].Handle; +} + +HANDLE +GetRootKeyByName( + IN PCWSTR RootKeyName, + OUT PCWSTR* RootKeyMountPoint OPTIONAL) +{ + UCHAR i; + + for (i = 0; i < ARRAYSIZE(RootKeys); ++i) + { + if (!_wcsicmp(RootKeyName, RootKeys[i].Name)) + { + if (RootKeyMountPoint) + *RootKeyMountPoint = RootKeys[i].MountPoint; + return RootKeys[i].Handle; + } + } + + return NULL; } @@ -483,11 +508,11 @@ UNICODE_STRING Name, Value; PUNICODE_STRING ValuePtr; UINT Flags; - ULONG Length; WCHAR Buffer[MAX_INF_STRING_LENGTH]; INFCONTEXT Context; - HANDLE KeyHandle; + PCWSTR RootKeyName; + HANDLE RootKeyHandle, KeyHandle; BOOLEAN Ok; Ok = SetupFindFirstLineW(hInf, Section, NULL, &Context); @@ -499,15 +524,15 @@ /* get root */ if (!SetupGetStringFieldW(&Context, 1, Buffer, sizeof(Buffer)/sizeof(WCHAR), NULL)) continue; - if (!GetRootKey (Buffer)) + RootKeyHandle = GetRootKeyByName(Buffer, &RootKeyName); + if (!RootKeyHandle) continue; /* get key */ - Length = wcslen(Buffer); - if (!SetupGetStringFieldW(&Context, 2, Buffer + Length, sizeof(Buffer)/sizeof(WCHAR) - Length, NULL)) + if (!SetupGetStringFieldW(&Context, 2, Buffer, sizeof(Buffer)/sizeof(WCHAR), NULL)) *Buffer = 0; - DPRINT("KeyName: <%S>\n", Buffer); + DPRINT("KeyName: <%S\\%S>\n", RootKeyName, Buffer); /* get flags */ if (!SetupGetIntField(&Context, 4, (PINT)&Flags)) @@ -519,7 +544,7 @@ InitializeObjectAttributes(&ObjectAttributes, &Name, OBJ_CASE_INSENSITIVE, - NULL, + RootKeyHandle, NULL); if (Delete || (Flags & FLG_ADDREG_OVERWRITEONLY)) @@ -623,13 +648,611 @@ return TRUE; } +/* + * Should be called under privileges + */ +// static +NTSTATUS +CreateRegistryFile( + IN PUNICODE_STRING InstallPath, + IN PCWSTR RegistryKey, + IN HANDLE ProtoKeyHandle) +{ + NTSTATUS Status; + HANDLE FileHandle; + UNICODE_STRING FileName; + OBJECT_ATTRIBUTES ObjectAttributes; + IO_STATUS_BLOCK IoStatusBlock; + WCHAR PathBuffer[MAX_PATH]; + + /* Create the file */ + CombinePaths(PathBuffer, ARRAYSIZE(PathBuffer), 3, + InstallPath->Buffer, L"System32\\config", RegistryKey); + RtlInitUnicodeString(&FileName, PathBuffer); + InitializeObjectAttributes(&ObjectAttributes, + &FileName, + OBJ_CASE_INSENSITIVE, + NULL, // Could have been installpath, etc... + NULL); + + Status = NtCreateFile(&FileHandle, + FILE_GENERIC_WRITE, + &ObjectAttributes, + &IoStatusBlock, + NULL, + FILE_ATTRIBUTE_NORMAL, + 0, + FILE_OVERWRITE_IF, + FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE, + NULL, + 0); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtCreateFile(%wZ) failed, Status 0x%08lx\n", &FileName, Status); + return Status; + } + + /* Save the selected hive into the file */ + Status = NtSaveKeyEx(ProtoKeyHandle, FileHandle, REG_LATEST_FORMAT); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtSaveKeyEx(%wZ) failed, Status 0x%08lx\n", &FileName, Status); + } + + /* Close the file and return */ + NtClose(FileHandle); + return Status; +} + +static BOOLEAN +CmpLinkKeyToHive( + IN HANDLE RootLinkKeyHandle OPTIONAL, + IN PCWSTR LinkKeyName, + IN PCWSTR TargetKeyName) +{ + static UNICODE_STRING CmSymbolicLinkValueName = + RTL_CONSTANT_STRING(L"SymbolicLinkValue"); + + NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING KeyName; + HANDLE TargetKeyHandle; + ULONG Disposition; + + /* Initialize the object attributes */ + RtlInitUnicodeString(&KeyName, LinkKeyName); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + RootLinkKeyHandle, + NULL); + + /* Create the link key */ + Status = NtCreateKey(&TargetKeyHandle, + KEY_SET_VALUE | KEY_CREATE_LINK, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_VOLATILE | REG_OPTION_CREATE_LINK, + &Disposition); + if (!NT_SUCCESS(Status)) + { + DPRINT1("CmpLinkKeyToHive: couldn't create %S, Status = 0x%08lx\n", + LinkKeyName, Status); + return FALSE; + } + + /* Check if the new key was actually created */ + if (Disposition != REG_CREATED_NEW_KEY) + { + DPRINT1("CmpLinkKeyToHive: %S already exists!\n", LinkKeyName); + NtClose(TargetKeyHandle); + return FALSE; + } + + /* Set the target key name as link target */ + RtlInitUnicodeString(&KeyName, TargetKeyName); + Status = NtSetValueKey(TargetKeyHandle, + &CmSymbolicLinkValueName, + 0, + REG_LINK, + KeyName.Buffer, + KeyName.Length); + + /* Close the link key handle */ + NtClose(TargetKeyHandle); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("CmpLinkKeyToHive: couldn't create symbolic link for %S, Status = 0x%08lx\n", + TargetKeyName, Status); + return FALSE; + } + + return TRUE; +} + +/* + * Should be called under privileges + */ +// static +NTSTATUS +ConnectRegistry( + IN HKEY RootKey OPTIONAL, + // IN HANDLE RootDirectory OPTIONAL, + IN PUNICODE_STRING InstallPath, + IN PCWSTR RegistryKey, + // IN PUCHAR Descriptor, + // IN ULONG DescriptorLength, + IN PCWSTR RegMountPoint) +{ + NTSTATUS Status; + UNICODE_STRING KeyName, FileName; + OBJECT_ATTRIBUTES KeyObjectAttributes; + OBJECT_ATTRIBUTES FileObjectAttributes; + WCHAR PathBuffer[MAX_PATH]; + + RtlInitUnicodeString(&KeyName, RegMountPoint); + InitializeObjectAttributes(&KeyObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + RootKey, + NULL); + + CombinePaths(PathBuffer, ARRAYSIZE(PathBuffer), 3, + InstallPath->Buffer, L"System32\\config", RegistryKey); + RtlInitUnicodeString(&FileName, PathBuffer); + InitializeObjectAttributes(&FileObjectAttributes, + &FileName, + OBJ_CASE_INSENSITIVE, + NULL, // RootDirectory, + NULL); + +#if 0 + IN PCMHIVE HiveToConnect; + /* + * Add security to the root key. + * NOTE: One can implement this using the lpSecurityAttributes + * parameter of RegCreateKeyExW. + */ + Status = CmiCreateSecurityKey(&HiveToConnect->Hive, + HiveToConnect->Hive.BaseBlock->RootCell, + Descriptor, DescriptorLength); + if (!NT_SUCCESS(Status)) + DPRINT1("Failed to add security for root key '%S'\n", Path); +#endif + + /* Mount the registry hive in the registry namespace */ + Status = NtLoadKey(&KeyObjectAttributes, &FileObjectAttributes); + + return Status; +} + +NTSTATUS +RegInitializeRegistry( + IN PUNICODE_STRING InstallPath) +{ + NTSTATUS Status; + HANDLE KeyHandle; + UNICODE_STRING KeyName; + OBJECT_ATTRIBUTES ObjectAttributes; + BOOLEAN PrivilegeSet[2] = {FALSE, FALSE}; + ULONG Disposition; + UINT i; + PCWSTR RegistryKeys[] = + { + L"SYSTEM", + L"SOFTWARE", + L"DEFAULT", // L".DEFAULT", + // L"SAM", + // L"SECURITY", + // L"BCD00000000", + }; + +#if 0 + /* Initialize the current session registry */ + Status = NtInitializeRegistry(CM_BOOT_FLAG_SETUP); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtInitializeRegistry() failed (Status %lx)\n", Status); + return Status; + } +#endif + + /* Acquire restore privilege */ + Status = RtlAdjustPrivilege(SE_RESTORE_PRIVILEGE, TRUE, FALSE, &PrivilegeSet[0]); + if (!NT_SUCCESS(Status)) + { + DPRINT1("RtlAdjustPrivilege(SE_RESTORE_PRIVILEGE) failed (Status 0x%08lx)\n", Status); + /* Exit prematurely here.... */ + return Status; + } + + /* Acquire backup privilege */ + Status = RtlAdjustPrivilege(SE_BACKUP_PRIVILEGE, TRUE, FALSE, &PrivilegeSet[1]); + if (!NT_SUCCESS(Status)) + { + DPRINT1("RtlAdjustPrivilege(SE_BACKUP_PRIVILEGE) failed (Status 0x%08lx)\n", Status); + RtlAdjustPrivilege(SE_RESTORE_PRIVILEGE, PrivilegeSet[0], FALSE, &PrivilegeSet[0]); + /* Exit prematurely here.... */ + return Status; + } + + /* + * Create the template proto-hive. + * + * Use a dummy root key name: + * - On 2k/XP/2k3, this is "$$$PROTO.HIV" + * - On Vista+, this is "CMI-CreateHive{guid}" + * See
https://github.com/libyal/winreg-kb/blob/master/documentation/Registry%20fi…
+ * for more information. + */ + RtlInitUnicodeString(&KeyName, + L"\\Registry\\Machine\\SYSTEM\\$$$PROTO.HIV"); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + Status = NtCreateKey(&KeyHandle, + KEY_ALL_ACCESS, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_NON_VOLATILE, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtCreateKey() failed to create the proto-hive (Status %lx)\n", Status); + goto Quit; + } + NtFlushKey(KeyHandle); + + for (i = 0; i < ARRAYSIZE(RegistryKeys); ++i) + { + Status = CreateRegistryFile(InstallPath, + RegistryKeys[i], + KeyHandle); + if (!NT_SUCCESS(Status)) + { + DPRINT1("CreateRegistryFile(%S) failed, Status 0x%08lx\n", RegistryKeys[i], Status); + /* Exit prematurely here.... */ + /* That is now done, clean everything up! */ + NtDeleteKey(KeyHandle); + NtClose(KeyHandle); + goto Quit; + } + } + + /* That is now done, clean everything up! */ + NtDeleteKey(KeyHandle); + NtClose(KeyHandle); + + + /* + * Prepare the installation roots. Since we cannot create real registry keys + * inside the master keys (\Registry, \Registry\Machine or \Registry\User), + * we need to perform some SymLink tricks instead. + */ + + /* Our offline HKLM '\Registry\Machine' is inside '\Registry\Machine\SYSTEM\USetup_Machine' */ + RtlInitUnicodeString(&KeyName, RootKeys[GetPredefKeyIndex(HKEY_LOCAL_MACHINE)].MountPoint); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + KeyHandle = NULL; + Status = NtCreateKey(&KeyHandle, + KEY_ALL_ACCESS, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_VOLATILE, + &Disposition); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtCreateKey(%wZ) failed (Status 0x%08lx)\n", &KeyName, Status); + // return Status; + } + RootKeys[GetPredefKeyIndex(HKEY_LOCAL_MACHINE)].Handle = KeyHandle; + + /* Our offline HKU '\Registry\User' is inside '\Registry\Machine\SYSTEM\USetup_User' */ + RtlInitUnicodeString(&KeyName, RootKeys[GetPredefKeyIndex(HKEY_USERS)].MountPoint); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + KeyHandle = NULL; + Status = NtCreateKey(&KeyHandle, + KEY_ALL_ACCESS, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_VOLATILE, + &Disposition); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtCreateKey(%wZ) failed (Status 0x%08lx)\n", &KeyName, Status); + // return Status; + } + RootKeys[GetPredefKeyIndex(HKEY_USERS)].Handle = KeyHandle; + + + + /* + * Now properly mount the offline hive files + */ + + /* Create SYSTEM key */ + Status = + ConnectRegistry(NULL, + InstallPath, + RegistryKeys[0], + // SystemSecurity, sizeof(SystemSecurity), + L"\\Registry\\Machine\\USetup_SYSTEM"); + if (!NT_SUCCESS(Status)) + { + DPRINT1("ConnectRegistry(SYSTEM) failed, Status 0x%08lx\n", Status); + } + + /* Create the 'HKLM\SYSTEM' symlink to this key */ + if (!CmpLinkKeyToHive(RootKeys[GetPredefKeyIndex(HKEY_LOCAL_MACHINE)].Handle, + L"SYSTEM", + L"\\Registry\\Machine\\USetup_SYSTEM")) + { + DPRINT1("CmpLinkKeyToHive(SYSTEM) failed!\n"); + } + + + /* Create SOFTWARE key */ + Status = + ConnectRegistry(NULL, + InstallPath, + RegistryKeys[1], + // SoftwareSecurity, sizeof(SoftwareSecurity), + L"\\Registry\\Machine\\USetup_SOFTWARE"); + if (!NT_SUCCESS(Status)) + { + DPRINT1("ConnectRegistry(SOFTWARE) failed, Status 0x%08lx\n", Status); + } + + /* Create the 'HKLM\Software' symlink to this key */ + if (!CmpLinkKeyToHive(RootKeys[GetPredefKeyIndex(HKEY_LOCAL_MACHINE)].Handle, + L"Software", + L"\\Registry\\Machine\\USetup_SOFTWARE")) + { + DPRINT1("CmpLinkKeyToHive(SOFTWARE) failed!\n"); + } + + + /* Create DEFAULT key */ + Status = + ConnectRegistry(NULL, + InstallPath, + RegistryKeys[2], + // SystemSecurity, sizeof(SystemSecurity), + L"\\Registry\\User\\USetup_DEFAULT"); + if (!NT_SUCCESS(Status)) + { + DPRINT1("ConnectRegistry(DEFAULT) failed, Status 0x%08lx\n", Status); + } + + /* Create the 'HKU\.DEFAULT' symlink to this key */ + if (!CmpLinkKeyToHive(RootKeys[GetPredefKeyIndex(HKEY_USERS)].Handle, + L".DEFAULT", + L"\\Registry\\User\\USetup_DEFAULT")) + { + DPRINT1("CmpLinkKeyToHive(DEFAULT) failed!\n"); + } + + /* HKCU is a handle to 'HKU\.DEFAULT' */ +#if 0 + RtlInitUnicodeString(&KeyName, L".DEFAULT"); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + RootKeys[GetPredefKeyIndex(HKEY_USERS)].Handle, + NULL); +#else + RtlInitUnicodeString(&KeyName, RootKeys[GetPredefKeyIndex(HKEY_CURRENT_USER)].MountPoint); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); +#endif + KeyHandle = NULL; + Status = NtOpenKey(&KeyHandle, + KEY_ALL_ACCESS, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtOpenKey(%wZ) failed (Status %lx)\n", &KeyName, Status); + } + RootKeys[GetPredefKeyIndex(HKEY_CURRENT_USER)].Handle = KeyHandle; + + + /* HKCR is a handle to 'HKLM\Software\Classes' */ +#if 0 + RtlInitUnicodeString(&KeyName, L"Software\\Classes"); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + RootKeys[GetPredefKeyIndex(HKEY_LOCAL_MACHINE)].Handle, + NULL); +#else + RtlInitUnicodeString(&KeyName, RootKeys[GetPredefKeyIndex(HKEY_CLASSES_ROOT)].MountPoint); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); +#endif + KeyHandle = NULL; + Status = NtCreateKey(&KeyHandle, + KEY_ALL_ACCESS, + &ObjectAttributes, + 0, + NULL, + 0, + &Disposition); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtCreateKey(%wZ) failed (Status %lx)\n", &KeyName, Status); + } + else + { + DPRINT1("NtCreateKey() succeeded to %s the %wZ key (Status %lx)\n", + Disposition == REG_CREATED_NEW_KEY ? "create" : /* REG_OPENED_EXISTING_KEY */ "open", + &KeyName, Status); + } + RootKeys[GetPredefKeyIndex(HKEY_CLASSES_ROOT)].Handle = KeyHandle; + + +#if 0 + /* Create SAM key */ + ConnectRegistry(NULL, + &SamHive, + // SystemSecurity, sizeof(SystemSecurity), + L"\\Registry\\Machine\\USetup_SAM"); + + /* Create SECURITY key */ + ConnectRegistry(NULL, + &SecurityHive, + // NULL, 0, + L"\\Registry\\Machine\\USetup_SECURITY"); + + /* Create BCD key */ + ConnectRegistry(NULL, + &BcdHive, + // BcdSecurity, sizeof(BcdSecurity), + L"\\Registry\\Machine\\USetup_BCD00000000"); +#endif + + Status = STATUS_SUCCESS; + + + /* Create the 'HKLM\SYSTEM\ControlSet001' key */ + // L"\\Registry\\Machine\\SYSTEM\\USetup_Machine\\SYSTEM\\ControlSet001" + RtlInitUnicodeString(&KeyName, L"SYSTEM\\ControlSet001"); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + RootKeys[GetPredefKeyIndex(HKEY_LOCAL_MACHINE)].Handle, + NULL); + Status = NtCreateKey(&KeyHandle, + KEY_ALL_ACCESS, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_NON_VOLATILE, + &Disposition); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtCreateKey() failed to create the ControlSet001 key (Status %lx)\n", Status); + // return Status; + } + else + { + DPRINT1("NtCreateKey() succeeded to %s the ControlSet001 key (Status %lx)\n", + Disposition == REG_CREATED_NEW_KEY ? "create" : /* REG_OPENED_EXISTING_KEY */ "open", + Status); + } + NtClose(KeyHandle); + + /* Create the 'HKLM\SYSTEM\CurrentControlSet' symlink */ + if (!CmpLinkKeyToHive(RootKeys[GetPredefKeyIndex(HKEY_LOCAL_MACHINE)].Handle, + L"SYSTEM\\CurrentControlSet", + L"\\Registry\\Machine\\SYSTEM\\USetup_Machine\\SYSTEM\\ControlSet001")) + { + DPRINT1("CmpLinkKeyToHive(CurrentControlSet) failed!\n"); + } + + +Quit: + /* Remove restore and backup privileges */ + RtlAdjustPrivilege(SE_BACKUP_PRIVILEGE, PrivilegeSet[1], FALSE, &PrivilegeSet[1]); + RtlAdjustPrivilege(SE_RESTORE_PRIVILEGE, PrivilegeSet[0], FALSE, &PrivilegeSet[0]); + + return Status; +} + +VOID +RegCleanupRegistry(VOID) +{ + NTSTATUS Status; + UNICODE_STRING KeyName; + OBJECT_ATTRIBUTES KeyObjectAttributes; + BOOLEAN PrivilegeSet[2] = {FALSE, FALSE}; + UCHAR i; + + for (i = 0; i < ARRAYSIZE(RootKeys); ++i) + { + if (RootKeys[i].Handle) + { + NtClose(RootKeys[i].Handle); + RootKeys[i].Handle = NULL; + } + } + + /* Acquire restore privilege */ + Status = RtlAdjustPrivilege(SE_RESTORE_PRIVILEGE, TRUE, FALSE, &PrivilegeSet[0]); + if (!NT_SUCCESS(Status)) + { + DPRINT1("RtlAdjustPrivilege(SE_RESTORE_PRIVILEGE) failed (Status 0x%08lx)\n", Status); + /* Exit prematurely here.... */ + return; + } + + /* Acquire backup privilege */ + Status = RtlAdjustPrivilege(SE_BACKUP_PRIVILEGE, TRUE, FALSE, &PrivilegeSet[1]); + if (!NT_SUCCESS(Status)) + { + DPRINT1("RtlAdjustPrivilege(SE_BACKUP_PRIVILEGE) failed (Status 0x%08lx)\n", Status); + RtlAdjustPrivilege(SE_RESTORE_PRIVILEGE, PrivilegeSet[0], FALSE, &PrivilegeSet[0]); + /* Exit prematurely here.... */ + return; + } + + InitializeObjectAttributes(&KeyObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\USetup_SYSTEM"); + Status = NtUnloadKey(&KeyObjectAttributes); + + RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\USetup_SOFTWARE"); + Status = NtUnloadKey(&KeyObjectAttributes); + + RtlInitUnicodeString(&KeyName, L"\\Registry\\User\\USetup_DEFAULT"); + Status = NtUnloadKey(&KeyObjectAttributes); + +#if 0 + RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\USetup_SAM"); + Status = NtUnloadKey(&KeyObjectAttributes); + + RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\USetup_SECURITY"); + Status = NtUnloadKey(&KeyObjectAttributes); + + RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\USetup_BCD00000000"); + Status = NtUnloadKey(&KeyObjectAttributes); +#endif + + /* Remove restore and backup privileges */ + RtlAdjustPrivilege(SE_BACKUP_PRIVILEGE, PrivilegeSet[1], FALSE, &PrivilegeSet[1]); + RtlAdjustPrivilege(SE_RESTORE_PRIVILEGE, PrivilegeSet[0], FALSE, &PrivilegeSet[0]); +} VOID SetDefaultPagefile( WCHAR Drive) { OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management"); + UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management"); UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"PagingFiles"); WCHAR ValueBuffer[] = L"?:\\pagefile.sys 0 0\0"; HANDLE KeyHandle; @@ -638,7 +1261,7 @@ InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, - NULL, + RootKeys[GetPredefKeyIndex(HKEY_LOCAL_MACHINE)].Handle, NULL); Status = NtOpenKey(&KeyHandle, KEY_ALL_ACCESS, Modified: branches/setup_improvements/base/setup/usetup/registry.h URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
============================================================================== --- branches/setup_improvements/base/setup/usetup/registry.h [iso-8859-1] (original) +++ branches/setup_improvements/base/setup/usetup/registry.h [iso-8859-1] Sat Jun 3 16:22:42 2017 @@ -26,6 +26,16 @@ #pragma once +HANDLE +GetRootKeyByPredefKey( + IN HANDLE KeyHandle, + OUT PCWSTR* RootKeyMountPoint OPTIONAL); + +HANDLE +GetRootKeyByName( + IN PCWSTR RootKeyName, + OUT PCWSTR* RootKeyMountPoint OPTIONAL); + BOOLEAN ImportRegistryFile( PWSTR Filename, @@ -33,9 +43,12 @@ LCID LocaleId, BOOLEAN Delete); -BOOLEAN -SetInstallPathValue( - PUNICODE_STRING InstallPath); +NTSTATUS +RegInitializeRegistry( + IN PUNICODE_STRING InstallPath); + +VOID +RegCleanupRegistry(VOID); VOID SetDefaultPagefile( Modified: branches/setup_improvements/base/setup/usetup/settings.c URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
============================================================================== --- branches/setup_improvements/base/setup/usetup/settings.c [iso-8859-1] (original) +++ branches/setup_improvements/base/setup/usetup/settings.c [iso-8859-1] Sat Jun 3 16:22:42 2017 @@ -215,7 +215,7 @@ NULL); Status = NtOpenKey(&ProcessorsKey, - KEY_QUERY_VALUE , + KEY_QUERY_VALUE, &ObjectAttributes); if (!NT_SUCCESS(Status)) { @@ -677,14 +677,17 @@ HINF InfFile, PGENERIC_LIST List) { + NTSTATUS Status; PGENERIC_LIST_ENTRY Entry; INFCONTEXT Context; + PWCHAR Buffer; PWCHAR ServiceName; ULONG StartValue; - NTSTATUS Status; - WCHAR RegPath [255]; - PWCHAR Buffer; ULONG Width, Height, Bpp; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING KeyName; + HANDLE KeyHandle; + WCHAR RegPath[255]; DPRINT("ProcessDisplayRegistry() called\n"); @@ -701,7 +704,7 @@ return FALSE; } - /* Enable the right driver */ + /* Enable the correct driver */ if (!INF_GetDataField(&Context, 3, &ServiceName)) { DPRINT1("INF_GetDataField() failed\n"); @@ -709,15 +712,31 @@ } ASSERT(wcslen(ServiceName) < 10); - DPRINT("Service name: %S\n", ServiceName); + DPRINT1("Service name: '%S'\n", ServiceName); + + swprintf(RegPath, L"System\\CurrentControlSet\\Services\\%s", ServiceName); + RtlInitUnicodeString(&KeyName, RegPath); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + GetRootKeyByPredefKey(HKEY_LOCAL_MACHINE, NULL), + NULL); + Status = NtOpenKey(&KeyHandle, + KEY_SET_VALUE, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtOpenKey() failed (Status %lx)\n", Status); + return FALSE; + } StartValue = 1; - Status = RtlWriteRegistryValue(RTL_REGISTRY_SERVICES, - ServiceName, + Status = RtlWriteRegistryValue(RTL_REGISTRY_HANDLE, KeyHandle, L"Start", REG_DWORD, &StartValue, - sizeof(ULONG)); + sizeof(StartValue)); + NtClose(KeyHandle); if (!NT_SUCCESS(Status)) { DPRINT1("RtlWriteRegistryValue() failed (Status %lx)\n", Status); @@ -725,7 +744,6 @@ } /* Set the resolution */ - swprintf(RegPath, L"\\Registry\\Machine\\System\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Services\\%s\\Device0", ServiceName); if (!INF_GetDataField(&Context, 4, &Buffer)) { @@ -733,56 +751,79 @@ return FALSE; } + swprintf(RegPath, + L"System\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Services\\%s\\Device0", + ServiceName); + DPRINT1("RegPath: '%S'\n", RegPath); + RtlInitUnicodeString(&KeyName, RegPath); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + GetRootKeyByPredefKey(HKEY_LOCAL_MACHINE, NULL), + NULL); + Status = NtOpenKey(&KeyHandle, + KEY_SET_VALUE, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtOpenKey() failed (Status %lx)\n", Status); + return FALSE; + } + Width = wcstoul(Buffer, NULL, 10); - Status = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE, - RegPath, + Status = RtlWriteRegistryValue(RTL_REGISTRY_HANDLE, KeyHandle, L"DefaultSettings.XResolution", REG_DWORD, &Width, - sizeof(ULONG)); + sizeof(Width)); if (!NT_SUCCESS(Status)) { DPRINT1("RtlWriteRegistryValue() failed (Status %lx)\n", Status); + NtClose(KeyHandle); return FALSE; } if (!INF_GetDataField(&Context, 5, &Buffer)) { DPRINT1("INF_GetDataField() failed\n"); + NtClose(KeyHandle); return FALSE; } Height = wcstoul(Buffer, 0, 0); - Status = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE, - RegPath, + Status = RtlWriteRegistryValue(RTL_REGISTRY_HANDLE, KeyHandle, L"DefaultSettings.YResolution", REG_DWORD, &Height, - sizeof(ULONG)); + sizeof(Height)); if (!NT_SUCCESS(Status)) { DPRINT1("RtlWriteRegistryValue() failed (Status %lx)\n", Status); + NtClose(KeyHandle); return FALSE; } if (!INF_GetDataField(&Context, 6, &Buffer)) { DPRINT1("INF_GetDataField() failed\n"); + NtClose(KeyHandle); return FALSE; } Bpp = wcstoul(Buffer, 0, 0); - Status = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE, - RegPath, + Status = RtlWriteRegistryValue(RTL_REGISTRY_HANDLE, KeyHandle, L"DefaultSettings.BitsPerPel", REG_DWORD, &Bpp, - sizeof(ULONG)); + sizeof(Bpp)); if (!NT_SUCCESS(Status)) { DPRINT1("RtlWriteRegistryValue() failed (Status %lx)\n", Status); - return FALSE; - } + NtClose(KeyHandle); + return FALSE; + } + + NtClose(KeyHandle); DPRINT("ProcessDisplayRegistry() done\n"); @@ -815,17 +856,17 @@ /* Open the default users locale key */ RtlInitUnicodeString(&KeyName, - L"\\Registry\\User\\.DEFAULT\\Control Panel\\International"); + L".DEFAULT\\Control Panel\\International"); InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, - NULL, + GetRootKeyByPredefKey(HKEY_USERS, NULL), NULL); - Status = NtOpenKey(&KeyHandle, - KEY_SET_VALUE, - &ObjectAttributes); + Status = NtOpenKey(&KeyHandle, + KEY_SET_VALUE, + &ObjectAttributes); if (!NT_SUCCESS(Status)) { DPRINT1("NtOpenKey() failed (Status %lx)\n", Status); @@ -833,8 +874,7 @@ } /* Set default user locale */ - RtlInitUnicodeString(&ValueName, - L"Locale"); + RtlInitUnicodeString(&ValueName, L"Locale"); Status = NtSetValueKey(KeyHandle, &ValueName, 0, @@ -854,17 +894,17 @@ /* Open the NLS language key */ RtlInitUnicodeString(&KeyName, - L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\Language"); + L"SYSTEM\\CurrentControlSet\\Control\\NLS\\Language"); InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, - NULL, + GetRootKeyByPredefKey(HKEY_LOCAL_MACHINE, NULL), NULL); - Status = NtOpenKey(&KeyHandle, - KEY_SET_VALUE, - &ObjectAttributes); + Status = NtOpenKey(&KeyHandle, + KEY_SET_VALUE, + &ObjectAttributes); if (!NT_SUCCESS(Status)) { DPRINT1("NtOpenKey() failed (Status %lx)\n", Status); @@ -872,8 +912,7 @@ } /* Set default language */ - RtlInitUnicodeString(&ValueName, - L"Default"); + RtlInitUnicodeString(&ValueName, L"Default"); Status = NtSetValueKey(KeyHandle, &ValueName, 0, @@ -888,14 +927,13 @@ } /* Set install language */ - RtlInitUnicodeString(&ValueName, - L"InstallLanguage"); - Status = NtSetValueKey (KeyHandle, - &ValueName, - 0, - REG_SZ, - (PVOID)LanguageId, - (wcslen(LanguageId) + 1) * sizeof(WCHAR)); + RtlInitUnicodeString(&ValueName, L"InstallLanguage"); + Status = NtSetValueKey(KeyHandle, + &ValueName, + 0, + REG_SZ, + (PVOID)LanguageId, + (wcslen(LanguageId) + 1) * sizeof(WCHAR)); NtClose(KeyHandle); if (!NT_SUCCESS(Status)) { @@ -1192,22 +1230,18 @@ SetGeoID( PWCHAR Id) { + NTSTATUS Status; OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING KeyName; - UNICODE_STRING ValueName; + UNICODE_STRING Name; HANDLE KeyHandle; - WCHAR szKeyName[] = L"\\Registry\\User\\.DEFAULT\\Control Panel\\International\\Geo"; - WCHAR szValueName[] = L"Nation"; - NTSTATUS Status; - - RtlInitUnicodeString(&KeyName, - szKeyName); + + RtlInitUnicodeString(&Name, + L".DEFAULT\\Control Panel\\International\\Geo"); InitializeObjectAttributes(&ObjectAttributes, - &KeyName, + &Name, OBJ_CASE_INSENSITIVE, - NULL, + GetRootKeyByPredefKey(HKEY_USERS, NULL), NULL); - Status = NtOpenKey(&KeyHandle, KEY_SET_VALUE, &ObjectAttributes); @@ -1217,9 +1251,9 @@ return FALSE; } - RtlInitUnicodeString(&ValueName, szValueName); + RtlInitUnicodeString(&Name, L"Nation"); Status = NtSetValueKey(KeyHandle, - &ValueName, + &Name, 0, REG_SZ, (PVOID)Id,
7 years, 6 months
1
0
0
0
[akhaldi] 74765: [PSDK] Update asptlb.idl. CORE-13362
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 15:44:58 2017 New Revision: 74765 URL:
http://svn.reactos.org/svn/reactos?rev=74765&view=rev
Log: [PSDK] Update asptlb.idl. CORE-13362 Modified: trunk/reactos/sdk/include/psdk/asptlb.idl Modified: trunk/reactos/sdk/include/psdk/asptlb.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/asptlb.id…
============================================================================== --- trunk/reactos/sdk/include/psdk/asptlb.idl [iso-8859-1] (original) +++ trunk/reactos/sdk/include/psdk/asptlb.idl [iso-8859-1] Sat Jun 3 15:44:58 2017 @@ -23,22 +23,21 @@ [ object, dual, - uuid(D97A6DA0-A85F-11df-83AE-00A0C90C2BD8) + uuid(D97A6DA0-A864-11cf-83BE-00A0C90C2BD8) ] interface IRequestDictionary : IDispatch { [propget] - HRESULT Item(IRequestDictionary *iface, [in, optional] VARIANT Var, - [retval, out] VARIANT *pVariantReturn); + HRESULT Item([in, optional] VARIANT Var, [retval, out] VARIANT *pVariantReturn); [restricted, propget] - HRESULT _NewEnum(IRequestDictionary *iface, [retval, out] IUnknown **ppEnumReturn); + HRESULT _NewEnum([retval, out] IUnknown **ppEnumReturn); [propget] - HRESULT Count(IRequestDictionary *iface, [retval, out] int *cStrRet); + HRESULT Count([retval, out] int *count); [propget] - HRESULT Key(IRequestDictionary *iface, [in] VARIANT VarKey, [retval, out]VARIANT *pvar); + HRESULT Key([in] VARIANT key, [retval, out] VARIANT *value); }; [ @@ -49,85 +48,85 @@ interface IResponse : IDispatch { [propget] - HRESULT Buffer(IResponse *iface, [retval, out] VARIANT_BOOL *fIsBuffering); + HRESULT Buffer([retval, out] VARIANT_BOOL *is_buffering); [propput] - HRESULT Buffer(IResponse *iface, [in] VARIANT_BOOL fIsBuffering); + HRESULT Buffer([in] VARIANT_BOOL is_buffering); [propget] - HRESULT ContentType(IResponse *iface, [retval, out] BSTR *pbstrContentTypeRet); + HRESULT ContentType([retval, out] BSTR *content_type); [propput] - HRESULT ContentType(IResponse *iface, [in] BSTR bstrContentType); + HRESULT ContentType([in] BSTR content_type); [propget] - HRESULT Expires(IResponse *iface, [retval, out] VARIANT *pvarExpiresMinutesRet); + HRESULT Expires([retval, out] VARIANT *minutes); [propput] - HRESULT Expires(IResponse *iface, [in] long lExpiresMinutes); + HRESULT Expires([in] LONG minutes); [propget] - HRESULT ExpiresAbsolute(IResponse *iface, [retval, out] VARIANT *pvarExpiresRet); + HRESULT ExpiresAbsolute([retval, out] VARIANT *expires); [propput] - HRESULT ExpiresAbsolute(IResponse *iface, [in] DATE dtExpires); + HRESULT ExpiresAbsolute([in] DATE expires); [propget] - HRESULT Cookies(IResponse *iface, [retval, out] IRequestDictionary **ppCookies); + HRESULT Cookies([retval, out] IRequestDictionary **cookies); [propget] - HRESULT Status(IResponse *iface, [retval][out] BSTR *pbstrStatusRet); + HRESULT Status([retval, out] BSTR *status); [propput] - HRESULT Status(IResponse *iface, [in] BSTR bstrStatus); + HRESULT Status([in] BSTR status); [hidden] - HRESULT Add(IResponse *iface, [in] BSTR bstrHeaderValue, [in] BSTR bstrHeaderName); + HRESULT Add([in] BSTR value, [in] BSTR name); - HRESULT AddHeader(IResponse *iface, [in] BSTR bstrHeaderName, [in] BSTR bstrHeaderValue); + HRESULT AddHeader([in] BSTR name, [in] BSTR value); - HRESULT AppendToLog(IResponse *iface, [in] BSTR bstrLogEntry); + HRESULT AppendToLog([in] BSTR log_entry); - HRESULT BinaryWrite(IResponse *iface, [in] VARIANT varInput); + HRESULT BinaryWrite([in] VARIANT input); - HRESULT Clear(IResponse *iface); + HRESULT Clear(); - HRESULT End(IResponse *iface); + HRESULT End(); - HRESULT Flush(IResponse *iface); + HRESULT Flush(); - HRESULT Redirect(IResponse *iface, [in] BSTR bstrURL); + HRESULT Redirect(BSTR url); - HRESULT Write(IResponse *iface, [in] VARIANT varText); + HRESULT Write([in] VARIANT text); [hidden] - HRESULT WriteBlock(IResponse *iface, [in] short iBlockNumber); + HRESULT WriteBlock([in] short block_number); - HRESULT IsClientConnected(IResponse *iface, [retval, out] VARIANT_BOOL *pfIsClientConnected); + HRESULT IsClientConnected([retval, out] VARIANT_BOOL *is_connected); [propget] - HRESULT get_CharSet( IResponse *iface, [retval, out] BSTR *pbstrCharSetRet); + HRESULT CharSet([retval, out] BSTR *charset); [propput] - HRESULT put_CharSet(IResponse *iface, [in] BSTR bstrCharSet); + HRESULT CharSet([in] BSTR charset); - HRESULT Pics(IResponse *iface, [in] BSTR bstrHeaderValue); + HRESULT Pics([in] BSTR value); [propget] - HRESULT get_CacheControl(IResponse *iface, [retval, out] BSTR *pbstrCacheControl); + HRESULT CacheControl([retval, out] BSTR *cache_control); [propput] - HRESULT put_CacheControl(IResponse *iface, [in] BSTR bstrCacheControl); + HRESULT CacheControl([in] BSTR cache_control); [propget] - HRESULT get_CodePage(IResponse *iface, [retval, out] long *plvar); + HRESULT CodePage([retval, out] LONG *codepage); [propput] - HRESULT put_CodePage(IResponse *iface, [in] long lvar); + HRESULT CodePage([in] LONG codepage); [propget] - HRESULT get_LCID(IResponse *iface, [retval, out] long *plvar); + HRESULT LCID([retval, out] LONG *lcid); [propput] - HRESULT put_LCID(IResponse *iface, [in] long lvar); -}; + HRESULT LCID([in] LONG lcid); +}
7 years, 6 months
1
0
0
0
[mjansen] 74764: [SHELL32] CMenuDeskBar: Prevent destruction of the start menu when receiving a WM_CLOSE message. CORE-12028
by mjansen@svn.reactos.org
Author: mjansen Date: Sat Jun 3 15:35:21 2017 New Revision: 74764 URL:
http://svn.reactos.org/svn/reactos?rev=74764&view=rev
Log: [SHELL32] CMenuDeskBar: Prevent destruction of the start menu when receiving a WM_CLOSE message. CORE-12028 Modified: trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.h Modified: trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellmen…
============================================================================== --- trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp [iso-8859-1] Sat Jun 3 15:35:21 2017 @@ -839,6 +839,12 @@ return 0; } +LRESULT CMenuDeskBar::_OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) +{ + /* Prevent the CMenuDeskBar from destroying on being sent a WM_CLOSE */ + return 0; +} + HRESULT CMenuDeskBar::_AdjustForTheme(BOOL bFlatStyle) { DWORD style = bFlatStyle ? WS_BORDER : WS_CLIPCHILDREN|WS_DLGFRAME; Modified: trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellmen…
============================================================================== --- trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.h [iso-8859-1] Sat Jun 3 15:35:21 2017 @@ -74,6 +74,7 @@ MESSAGE_HANDLER(WM_MOUSEACTIVATE, _OnMouseActivate) MESSAGE_HANDLER(WM_WININICHANGE , _OnWinIniChange) MESSAGE_HANDLER(WM_NCPAINT, _OnNcPaint) + MESSAGE_HANDLER(WM_CLOSE, _OnClose) END_MSG_MAP() BEGIN_COM_MAP(CMenuDeskBar) @@ -142,6 +143,7 @@ LRESULT _OnAppActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled); LRESULT _OnWinIniChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled); LRESULT _OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled); + LRESULT _OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled); HRESULT _AdjustForTheme(BOOL bFlatStyle); BOOL _IsSubMenuParent(HWND hwnd);
7 years, 6 months
1
0
0
0
[hbelusca] 74763: [USETUP]: Code formatting, making also the code closer to mkhive's one. Also, definitely remove the SetInstallPathValue() hack.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sat Jun 3 15:20:09 2017 New Revision: 74763 URL:
http://svn.reactos.org/svn/reactos?rev=74763&view=rev
Log: [USETUP]: Code formatting, making also the code closer to mkhive's one. Also, definitely remove the SetInstallPathValue() hack. Modified: branches/setup_improvements/base/setup/usetup/registry.c Modified: branches/setup_improvements/base/setup/usetup/registry.c URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
============================================================================== --- branches/setup_improvements/base/setup/usetup/registry.c [iso-8859-1] (original) +++ branches/setup_improvements/base/setup/usetup/registry.c [iso-8859-1] Sat Jun 3 15:20:09 2017 @@ -104,6 +104,7 @@ * * Append a multisz string to a multisz registry value. */ +// NOTE: Synced with setupapi/install.c ; see also mkhive/reginf.c #if 0 static void append_multi_sz_value (HANDLE hkey, @@ -117,7 +118,7 @@ if (RegQueryValueExW( hkey, value, NULL, &type, NULL, &size )) return; if (type != REG_MULTI_SZ) return; - if (!(buffer = HeapAlloc( GetProcessHeap(), 0, (size + str_size) * sizeof(WCHAR) ))) return; + if (!(buffer = HeapAlloc( GetProcessHeap(), 0, size + str_size * sizeof(WCHAR) ))) return; if (RegQueryValueExW( hkey, value, NULL, NULL, (BYTE *)buffer, &size )) goto done; /* compare each string against all the existing ones */ @@ -198,7 +199,7 @@ PINFCONTEXT Context, ULONG Flags) { - WCHAR EmptyStr = (WCHAR)0; + WCHAR EmptyStr = 0; ULONG Type; ULONG Size; @@ -223,7 +224,7 @@ #if 0 if (Flags & (FLG_ADDREG_NOCLOBBER | FLG_ADDREG_OVERWRITEONLY)) { - BOOL exists = !RegQueryValueExW( hkey, value, NULL, NULL, NULL, NULL ); + BOOL exists = !RegQueryValueExW( hkey, ValueName, NULL, NULL, NULL, NULL ); if (exists && (flags & FLG_ADDREG_NOCLOBBER)) return TRUE; if (!exists & (flags & FLG_ADDREG_OVERWRITEONLY)) @@ -274,7 +275,7 @@ if (Size) { - Str = (WCHAR*) RtlAllocateHeap (ProcessHeap, 0, Size * sizeof(WCHAR)); + Str = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, Size * sizeof(WCHAR)); if (Str == NULL) return FALSE; @@ -286,6 +287,7 @@ if (Str == NULL) return TRUE; + DPRINT1("append_multi_sz_value '%S' commented out, WHY??\n", ValueName); // append_multi_sz_value( hkey, value, str, size ); RtlFreeHeap (ProcessHeap, 0, Str); @@ -295,16 +297,16 @@ } else { - if (!SetupGetStringFieldW (Context, 5, NULL, 0, &Size)) + if (!SetupGetStringFieldW(Context, 5, NULL, 0, &Size)) Size = 0; if (Size) { - Str = (WCHAR*) RtlAllocateHeap (ProcessHeap, 0, Size * sizeof(WCHAR)); + Str = (WCHAR*)RtlAllocateHeap(ProcessHeap, 0, Size * sizeof(WCHAR)); if (Str == NULL) return FALSE; - SetupGetStringFieldW (Context, 5, Str, Size, NULL); + SetupGetStringFieldW(Context, 5, Str, Size, NULL); } } @@ -314,16 +316,12 @@ DPRINT("setting dword %wZ to %lx\n", ValueName, dw); -#ifdef __REACTOS__ NtSetValueKey (KeyHandle, ValueName, 0, Type, (PVOID)&dw, sizeof(ULONG)); -#else - RegSetValueExW(KeyHandle, ValueName, 0, Type, (const UCHAR*)&dw, sizeof(ULONG)); -#endif } else { @@ -331,29 +329,21 @@ if (Str) { -#ifdef __REACTOS__ NtSetValueKey (KeyHandle, ValueName, 0, Type, (PVOID)Str, Size * sizeof(WCHAR)); -#else - RegSetValueExW(KeyHandle, ValueName, 0, Type, (const UCHAR*)Str, Size * sizeof(WCHAR)); -#endif } else { -#ifdef __REACTOS__ NtSetValueKey (KeyHandle, ValueName, 0, Type, (PVOID)&EmptyStr, sizeof(WCHAR)); -#else - RegSetValueExW(KeyHandle, ValueName, 0, Type, (const UCHAR*)&EmptyStr, sizeof(WCHAR)); -#endif } } RtlFreeHeap (ProcessHeap, 0, Str); @@ -367,7 +357,7 @@ if (Size) { - Data = (unsigned char*) RtlAllocateHeap (ProcessHeap, 0, Size); + Data = (unsigned char*) RtlAllocateHeap(ProcessHeap, 0, Size); if (Data == NULL) return FALSE; @@ -375,16 +365,12 @@ SetupGetBinaryField (Context, 5, Data, Size, NULL); } -#ifdef __REACTOS__ NtSetValueKey (KeyHandle, ValueName, 0, Type, (PVOID)Data, Size); -#else - RegSetValueExW(KeyHandle, ValueName, 0, Type, (const UCHAR*)Data, Size); -#endif RtlFreeHeap (ProcessHeap, 0, Data); } @@ -392,99 +378,97 @@ return TRUE; } -#ifdef __REACTOS__ NTSTATUS -CreateNestedKey (PHANDLE KeyHandle, - ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes) -{ - OBJECT_ATTRIBUTES LocalObjectAttributes; - UNICODE_STRING LocalKeyName; - ULONG Disposition; - NTSTATUS Status; - USHORT FullNameLength; - PWCHAR Ptr; - HANDLE LocalKeyHandle; - - Status = NtCreateKey (KeyHandle, - KEY_ALL_ACCESS, - ObjectAttributes, - 0, - NULL, - 0, - &Disposition); - DPRINT("NtCreateKey(%wZ) called (Status %lx)\n", ObjectAttributes->ObjectName, Status); - if (Status != STATUS_OBJECT_NAME_NOT_FOUND) +CreateNestedKey(PHANDLE KeyHandle, + ACCESS_MASK DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes) +{ + OBJECT_ATTRIBUTES LocalObjectAttributes; + UNICODE_STRING LocalKeyName; + ULONG Disposition; + NTSTATUS Status; + USHORT FullNameLength; + PWCHAR Ptr; + HANDLE LocalKeyHandle; + + Status = NtCreateKey(KeyHandle, + KEY_ALL_ACCESS, + ObjectAttributes, + 0, + NULL, + 0, + &Disposition); + DPRINT("NtCreateKey(%wZ) called (Status %lx)\n", ObjectAttributes->ObjectName, Status); + if (Status != STATUS_OBJECT_NAME_NOT_FOUND) + return Status; + + /* Copy object attributes */ + RtlCopyMemory(&LocalObjectAttributes, + ObjectAttributes, + sizeof(OBJECT_ATTRIBUTES)); + RtlCreateUnicodeString(&LocalKeyName, + ObjectAttributes->ObjectName->Buffer); + LocalObjectAttributes.ObjectName = &LocalKeyName; + FullNameLength = LocalKeyName.Length; + + /* Remove the last part of the key name and try to create the key again. */ + while (Status == STATUS_OBJECT_NAME_NOT_FOUND) + { + Ptr = wcsrchr (LocalKeyName.Buffer, '\\'); + if (Ptr == NULL || Ptr == LocalKeyName.Buffer) + { + Status = STATUS_UNSUCCESSFUL; + break; + } + *Ptr = (WCHAR)0; + LocalKeyName.Length = wcslen (LocalKeyName.Buffer) * sizeof(WCHAR); + + Status = NtCreateKey(&LocalKeyHandle, + KEY_ALL_ACCESS, + &LocalObjectAttributes, + 0, + NULL, + 0, + &Disposition); + DPRINT("NtCreateKey(%wZ) called (Status %lx)\n", &LocalKeyName, Status); + } + + if (!NT_SUCCESS(Status)) + { + RtlFreeUnicodeString (&LocalKeyName); + return Status; + } + + /* Add removed parts of the key name and create them too. */ + while (TRUE) + { + if (LocalKeyName.Length == FullNameLength) + { + Status = STATUS_SUCCESS; + *KeyHandle = LocalKeyHandle; + break; + } + NtClose(LocalKeyHandle); + + LocalKeyName.Buffer[LocalKeyName.Length / sizeof(WCHAR)] = L'\\'; + LocalKeyName.Length = wcslen (LocalKeyName.Buffer) * sizeof(WCHAR); + + Status = NtCreateKey(&LocalKeyHandle, + KEY_ALL_ACCESS, + &LocalObjectAttributes, + 0, + NULL, + 0, + &Disposition); + DPRINT("NtCreateKey(%wZ) called (Status %lx)\n", &LocalKeyName, Status); + if (!NT_SUCCESS(Status)) + break; + } + + RtlFreeUnicodeString(&LocalKeyName); + return Status; - - /* Copy object attributes */ - RtlCopyMemory (&LocalObjectAttributes, - ObjectAttributes, - sizeof(OBJECT_ATTRIBUTES)); - RtlCreateUnicodeString (&LocalKeyName, - ObjectAttributes->ObjectName->Buffer); - LocalObjectAttributes.ObjectName = &LocalKeyName; - FullNameLength = LocalKeyName.Length; - - /* Remove the last part of the key name and try to create the key again. */ - while (Status == STATUS_OBJECT_NAME_NOT_FOUND) - { - Ptr = wcsrchr (LocalKeyName.Buffer, '\\'); - if (Ptr == NULL || Ptr == LocalKeyName.Buffer) - { - Status = STATUS_UNSUCCESSFUL; - break; - } - *Ptr = (WCHAR)0; - LocalKeyName.Length = wcslen (LocalKeyName.Buffer) * sizeof(WCHAR); - - Status = NtCreateKey (&LocalKeyHandle, - KEY_ALL_ACCESS, - &LocalObjectAttributes, - 0, - NULL, - 0, - &Disposition); - DPRINT("NtCreateKey(%wZ) called (Status %lx)\n", &LocalKeyName, Status); - } - - if (!NT_SUCCESS(Status)) - { - RtlFreeUnicodeString (&LocalKeyName); - return Status; - } - - /* Add removed parts of the key name and create them too. */ - while (TRUE) - { - if (LocalKeyName.Length == FullNameLength) - { - Status = STATUS_SUCCESS; - *KeyHandle = LocalKeyHandle; - break; - } - NtClose (LocalKeyHandle); - - LocalKeyName.Buffer[LocalKeyName.Length / sizeof(WCHAR)] = L'\\'; - LocalKeyName.Length = wcslen (LocalKeyName.Buffer) * sizeof(WCHAR); - - Status = NtCreateKey (&LocalKeyHandle, - KEY_ALL_ACCESS, - &LocalObjectAttributes, - 0, - NULL, - 0, - &Disposition); - DPRINT("NtCreateKey(%wZ) called (Status %lx)\n", &LocalKeyName, Status); - if (!NT_SUCCESS(Status)) - break; - } - - RtlFreeUnicodeString (&LocalKeyName); - - return Status; -} -#endif +} /*********************************************************************** * registry_callback @@ -494,124 +478,95 @@ static BOOLEAN registry_callback(HINF hInf, PCWSTR Section, BOOLEAN Delete) { - OBJECT_ATTRIBUTES ObjectAttributes; - WCHAR Buffer[MAX_INF_STRING_LENGTH]; - UNICODE_STRING Name; - UNICODE_STRING Value; - PUNICODE_STRING ValuePtr; - NTSTATUS Status; - UINT Flags; - ULONG Length; - - INFCONTEXT Context; - HANDLE KeyHandle; - BOOLEAN Ok; - - - Ok = SetupFindFirstLineW (hInf, Section, NULL, &Context); - - if (Ok) - { - for (;Ok; Ok = SetupFindNextLine (&Context, &Context)) - { - /* get root */ - if (!SetupGetStringFieldW (&Context, 1, Buffer, MAX_INF_STRING_LENGTH, NULL)) - continue; - if (!GetRootKey (Buffer)) + NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING Name, Value; + PUNICODE_STRING ValuePtr; + UINT Flags; + ULONG Length; + WCHAR Buffer[MAX_INF_STRING_LENGTH]; + + INFCONTEXT Context; + HANDLE KeyHandle; + BOOLEAN Ok; + + Ok = SetupFindFirstLineW(hInf, Section, NULL, &Context); + if (!Ok) + return TRUE; /* Don't fail if the section isn't present */ + + for (;Ok; Ok = SetupFindNextLine (&Context, &Context)) + { + /* get root */ + if (!SetupGetStringFieldW(&Context, 1, Buffer, sizeof(Buffer)/sizeof(WCHAR), NULL)) continue; - - /* get key */ - Length = wcslen (Buffer); - if (!SetupGetStringFieldW (&Context, 2, Buffer + Length, MAX_INF_STRING_LENGTH - Length, NULL)) + if (!GetRootKey (Buffer)) + continue; + + /* get key */ + Length = wcslen(Buffer); + if (!SetupGetStringFieldW(&Context, 2, Buffer + Length, sizeof(Buffer)/sizeof(WCHAR) - Length, NULL)) *Buffer = 0; - DPRINT("KeyName: <%S>\n", Buffer); - - /* get flags */ - if (!SetupGetIntField (&Context, 4, (PINT)&Flags)) + DPRINT("KeyName: <%S>\n", Buffer); + + /* get flags */ + if (!SetupGetIntField(&Context, 4, (PINT)&Flags)) Flags = 0; - DPRINT("Flags: %lx\n", Flags); - -#ifdef __REACTOS__ - RtlInitUnicodeString (&Name, - Buffer); - - InitializeObjectAttributes (&ObjectAttributes, - &Name, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); - - if (Delete || (Flags & FLG_ADDREG_OVERWRITEONLY)) + DPRINT("Flags: %lx\n", Flags); + + RtlInitUnicodeString(&Name, Buffer); + InitializeObjectAttributes(&ObjectAttributes, + &Name, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + if (Delete || (Flags & FLG_ADDREG_OVERWRITEONLY)) + { + Status = NtOpenKey(&KeyHandle, + KEY_ALL_ACCESS, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) { - Status = NtOpenKey (&KeyHandle, - KEY_ALL_ACCESS, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtOpenKey(%wZ) failed (Status %lx)\n", &Name, Status); - continue; /* ignore if it doesn't exist */ - } + DPRINT1("NtOpenKey(%wZ) failed (Status %lx)\n", &Name, Status); + continue; /* ignore if it doesn't exist */ } - else + } + else + { + Status = CreateNestedKey(&KeyHandle, + KEY_ALL_ACCESS, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) { - Status = CreateNestedKey (&KeyHandle, - KEY_ALL_ACCESS, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - DPRINT1("CreateNestedKey(%wZ) failed (Status %lx)\n", &Name, Status); - continue; - } + DPRINT1("CreateNestedKey(%wZ) failed (Status %lx)\n", &Name, Status); + continue; } -#else - if (Delete || (Flags & FLG_ADDREG_OVERWRITEONLY)) - { - LONG rc = RegOpenKeyW(NULL, Buffer, &KeyHandle); - if (rc != ERROR_SUCCESS) - { - DPRINT("RegOpenKeyW(%S) failed (error %lu)\n", Buffer, rc); - continue; /* ignore if it doesn't exist */ - } - } - else - { - LONG rc = RegCreateKeyW(NULL, Buffer, &KeyHandle); - if (rc != ERROR_SUCCESS) - { - DPRINT("RegCreateKeyW(%S) failed (error %lu)\n", Buffer, rc); - continue; - } - } -#endif - - /* get value name */ - if (SetupGetStringFieldW (&Context, 3, Buffer, MAX_INF_STRING_LENGTH, NULL)) - { - RtlInitUnicodeString (&Value, - Buffer); - ValuePtr = &Value; - } - else - { - ValuePtr = NULL; - } - - /* and now do it */ - if (!do_reg_operation (KeyHandle, ValuePtr, &Context, Flags)) - { - NtClose (KeyHandle); - return FALSE; - } - -#ifdef __REACTOS__ - NtClose (KeyHandle); -#endif - } - } - - return TRUE; + } + + /* get value name */ + if (SetupGetStringFieldW(&Context, 3, Buffer, sizeof(Buffer)/sizeof(WCHAR), NULL)) + { + RtlInitUnicodeString(&Value, Buffer); + ValuePtr = &Value; + } + else + { + ValuePtr = NULL; + } + + /* and now do it */ + if (!do_reg_operation(KeyHandle, ValuePtr, &Context, Flags)) + { + NtClose(KeyHandle); + return FALSE; + } + + NtClose(KeyHandle); + } + + return TRUE; } @@ -641,60 +596,30 @@ return FALSE; } +#if 0 + if (!registry_callback(hInf, L"DelReg", FALSE)) + { + DPRINT1("registry_callback() failed\n"); + InfCloseFile(hInf); + return FALSE; + } +#endif + if (!registry_callback(hInf, L"AddReg", FALSE)) { DPRINT1("registry_callback() failed\n"); + InfCloseFile(hInf); + return FALSE; } if (!registry_callback(hInf, L"AddReg.NT" Architecture, FALSE)) { DPRINT1("registry_callback() failed\n"); + InfCloseFile(hInf); + return FALSE; } InfCloseFile(hInf); - - return TRUE; -} - - -BOOLEAN -SetInstallPathValue( - PUNICODE_STRING InstallPath) -{ - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\HARDWARE"); - UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"InstallPath"); - HANDLE KeyHandle; - NTSTATUS Status; - - /* Create the 'secret' InstallPath key */ - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); - Status = NtOpenKey(&KeyHandle, - KEY_ALL_ACCESS, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtOpenKey() failed (Status %lx)\n", Status); - return FALSE; - } - - Status = NtSetValueKey(KeyHandle, - &ValueName, - 0, - REG_SZ, - (PVOID)InstallPath->Buffer, - InstallPath->Length + sizeof(WCHAR)); - NtClose(KeyHandle); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status); - return FALSE; - } - return TRUE; }
7 years, 6 months
1
0
0
0
[hbelusca] 74762: [FREELDR]: Adjust WinLdrInitSystemHive() and its callers to load either the regular SYSTEM hive, or the SETUPREG.HIV setup system hive, at startup. We now run the 1st-stage setup ...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sat Jun 3 14:55:18 2017 New Revision: 74762 URL:
http://svn.reactos.org/svn/reactos?rev=74762&view=rev
Log: [FREELDR]: Adjust WinLdrInitSystemHive() and its callers to load either the regular SYSTEM hive, or the SETUPREG.HIV setup system hive, at startup. We now run the 1st-stage setup with a regular system hive, similarly to what's done for the LiveCD, or for a regular ROS installation. The ExpInTextModeSetup hacks I previously removed are indeed now unneeded. Modified: branches/setup_improvements/boot/freeldr/freeldr/ntldr/setupldr.c branches/setup_improvements/boot/freeldr/freeldr/ntldr/winldr.c branches/setup_improvements/boot/freeldr/freeldr/ntldr/wlregistry.c Modified: branches/setup_improvements/boot/freeldr/freeldr/ntldr/setupldr.c URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/boot/freeldr…
============================================================================== --- branches/setup_improvements/boot/freeldr/freeldr/ntldr/setupldr.c [iso-8859-1] (original) +++ branches/setup_improvements/boot/freeldr/freeldr/ntldr/setupldr.c [iso-8859-1] Sat Jun 3 14:55:18 2017 @@ -74,8 +74,13 @@ return; } + TRACE("NLS data %s %s %s\n", AnsiName, OemName, LangName); + Success = WinLdrLoadNLSData(LoaderBlock, SearchPath, AnsiName, OemName, LangName); TRACE("NLS data loading %s\n", Success ? "successful" : "failed"); + + /* TODO: Load OEM HAL font */ + // Value "OemHalFont" } static VOID @@ -127,6 +132,9 @@ } } while (InfFindNextLine(&InfContext, &InfContext)); } + + +/* SETUP STARTER **************************************************************/ VOID LoadReactOSSetup(IN OperatingSystemItem* OperatingSystem, @@ -143,6 +151,7 @@ LPCSTR LoadOptions; LPSTR BootOptions; BOOLEAN BootFromFloppy; + BOOLEAN Success; ULONG i, ErrorLine; HINF InfHandle; INFCONTEXT InfContext; @@ -162,6 +171,8 @@ "reactos\\", NULL }; + + UiDrawStatusText("Setup is loading..."); /* Get OS setting value */ SettingsValue[0] = ANSI_NULL; @@ -303,8 +314,6 @@ TRACE("BootOptions: '%s'\n", BootOptions); - UiDrawStatusText("Setup is loading..."); - /* Allocate and minimalist-initialize LPB */ AllocateAndInitLPB(&LoaderBlock); @@ -315,16 +324,29 @@ /* Set textmode setup flag */ SetupBlock->Flags = SETUPLDR_TEXT_MODE; - /* Load NLS data, they are in system32 */ + /* Load the system hive "setupreg.hiv" for setup */ + UiDrawBackdrop(); + UiDrawProgressBarCenter(15, 100, "Loading setup system hive..."); + Success = WinLdrInitSystemHive(LoaderBlock, BootPath, TRUE); + TRACE("Setup SYSTEM hive %s\n", (Success ? "loaded" : "not loaded")); + /* Bail out if failure */ + if (!Success) + return; + + /* Load NLS data, they are in the System32 directory of the installation medium */ strcpy(FileName, BootPath); - strcat(FileName, "system32\\"); + strcat(FileName, "SYSTEM32\\"); SetupLdrLoadNlsData(LoaderBlock, InfHandle, FileName); + + // UiDrawStatusText("Press F6 if you need to install a 3rd-party SCSI or RAID driver..."); /* Get a list of boot drivers */ SetupLdrScanBootDrivers(&LoaderBlock->BootDriverListHead, InfHandle, BootPath); /* Close the inf file */ InfCloseFile(InfHandle); + + UiDrawStatusText("The Setup program is starting..."); /* Load ReactOS Setup */ LoadAndBootWindowsCommon(_WIN32_WINNT_WS03, Modified: branches/setup_improvements/boot/freeldr/freeldr/ntldr/winldr.c URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/boot/freeldr…
============================================================================== --- branches/setup_improvements/boot/freeldr/freeldr/ntldr/winldr.c [iso-8859-1] (original) +++ branches/setup_improvements/boot/freeldr/freeldr/ntldr/winldr.c [iso-8859-1] Sat Jun 3 14:55:18 2017 @@ -750,7 +750,7 @@ /* Load the system hive */ UiDrawBackdrop(); UiDrawProgressBarCenter(15, 100, "Loading system hive..."); - Success = WinLdrInitSystemHive(LoaderBlock, BootPath); + Success = WinLdrInitSystemHive(LoaderBlock, BootPath, FALSE); TRACE("SYSTEM hive %s\n", (Success ? "loaded" : "not loaded")); /* Bail out if failure */ if (!Success) Modified: branches/setup_improvements/boot/freeldr/freeldr/ntldr/wlregistry.c URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/boot/freeldr…
============================================================================== --- branches/setup_improvements/boot/freeldr/freeldr/ntldr/wlregistry.c [iso-8859-1] (original) +++ branches/setup_improvements/boot/freeldr/freeldr/ntldr/wlregistry.c [iso-8859-1] Sat Jun 3 14:55:18 2017 @@ -30,20 +30,21 @@ /* FUNCTIONS **************************************************************/ -BOOLEAN -WinLdrLoadSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, - IN LPCSTR DirectoryPath, - IN LPCSTR HiveName) +static BOOLEAN +WinLdrLoadSystemHive( + IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, + IN PCSTR DirectoryPath, + IN PCSTR HiveName) { ULONG FileId; - CHAR FullHiveName[256]; + CHAR FullHiveName[MAX_PATH]; ARC_STATUS Status; FILEINFORMATION FileInfo; ULONG HiveFileSize; ULONG_PTR HiveDataPhysical; PVOID HiveDataVirtual; ULONG BytesRead; - LPCWSTR FsService; + PCWSTR FsService; /* Concatenate path and filename to get the full name */ strcpy(FullHiveName, DirectoryPath); @@ -94,7 +95,7 @@ return FALSE; } - // Add boot filesystem driver to the list + /* Add boot filesystem driver to the list */ FsService = FsGetServiceName(FileId); if (FsService) { @@ -116,25 +117,40 @@ return TRUE; } -BOOLEAN WinLdrInitSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, - IN LPCSTR DirectoryPath) +BOOLEAN +WinLdrInitSystemHive( + IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, + IN PCSTR SystemRoot, + IN BOOLEAN Setup) { CHAR SearchPath[1024]; + PCSTR HiveName; BOOLEAN Success; - // There is a simple logic here: try to load usual hive (system), if it - // fails, then give system.alt a try, and finally try a system.sav - - // FIXME: For now we only try system - strcpy(SearchPath, DirectoryPath); - strcat(SearchPath, "SYSTEM32\\CONFIG\\"); - Success = WinLdrLoadSystemHive(LoaderBlock, SearchPath, "SYSTEM"); - - // Fail if failed... + if (Setup) + { + strcpy(SearchPath, SystemRoot); + HiveName = "SETUPREG.HIV"; + } + else + { + // There is a simple logic here: try to load usual hive (system), if it + // fails, then give system.alt a try, and finally try a system.sav + + // FIXME: For now we only try system + strcpy(SearchPath, SystemRoot); + strcat(SearchPath, "SYSTEM32\\CONFIG\\"); + HiveName = "SYSTEM"; + } + + ERR("WinLdrInitSystemHive: try to load hive %s%s\n", SearchPath, HiveName); + Success = WinLdrLoadSystemHive(LoaderBlock, SearchPath, HiveName); + + /* Fail if failed... */ if (!Success) return FALSE; - // Import what was loaded + /* Import what was loaded */ Success = RegImportBinaryHive(VaToPa(LoaderBlock->RegistryBase), LoaderBlock->RegistryLength); if (!Success) { @@ -142,7 +158,7 @@ return FALSE; } - // Initialize the 'CurrentControlSet' link + /* Initialize the 'CurrentControlSet' link */ if (RegInitCurrentControlSet(FALSE) != ERROR_SUCCESS) { UiMessageBox("Initializing CurrentControlSet link failed!"); @@ -159,10 +175,10 @@ CHAR AnsiName[256], OemName[256], LangName[256]; BOOLEAN Success; - // Scan registry and prepare boot drivers list + /* Scan registry and prepare boot drivers list */ WinLdrScanRegistry(&LoaderBlock->BootDriverListHead, DirectoryPath); - // Get names of NLS files + /* Get names of NLS files */ Success = WinLdrGetNLSNames(AnsiName, OemName, LangName); if (!Success) { @@ -172,13 +188,15 @@ TRACE("NLS data %s %s %s\n", AnsiName, OemName, LangName); - // Load NLS data + /* Load NLS data */ strcpy(SearchPath, DirectoryPath); strcat(SearchPath, "SYSTEM32\\"); Success = WinLdrLoadNLSData(LoaderBlock, SearchPath, AnsiName, OemName, LangName); TRACE("NLS data loading %s\n", Success ? "successful" : "failed"); /* TODO: Load OEM HAL font */ + // In HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage, + // REG_SZ value "OEMHAL" return TRUE; } @@ -208,7 +226,7 @@ return FALSE; } - /* get ANSI codepage */ + /* Get ANSI codepage */ BufferSize = sizeof(szIdBuffer); rc = RegQueryValue(hKey, L"ACP", NULL, (PUCHAR)szIdBuffer, &BufferSize); if (rc != ERROR_SUCCESS) @@ -227,7 +245,7 @@ } sprintf(AnsiName, "%S", NameBuffer); - /* get OEM codepage */ + /* Get OEM codepage */ BufferSize = sizeof(szIdBuffer); rc = RegQueryValue(hKey, L"OEMCP", NULL, (PUCHAR)szIdBuffer, &BufferSize); if (rc != ERROR_SUCCESS) @@ -246,7 +264,7 @@ } sprintf(OemName, "%S", NameBuffer); - /* open the language key */ + /* Open the language key */ rc = RegOpenKey(NULL, L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\Language", &hKey); @@ -256,7 +274,7 @@ return FALSE; } - /* get the Unicode case table */ + /* Get the Unicode case table */ BufferSize = sizeof(szIdBuffer); rc = RegQueryValue(hKey, L"Default", NULL, (PUCHAR)szIdBuffer, &BufferSize); if (rc != ERROR_SUCCESS)
7 years, 6 months
1
0
0
0
← Newer
1
...
46
47
48
49
50
51
52
53
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Results per page:
10
25
50
100
200