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
October 2006
----- 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
17 participants
357 discussions
Start a n
N
ew thread
[fireball] 24393: Merge 24392 & 24356 from trunk
by fireball@svn.reactos.org
Author: fireball Date: Wed Oct 4 16:34:53 2006 New Revision: 24393 URL:
http://svn.reactos.org/svn/reactos?rev=24393&view=rev
Log: Merge 24392 & 24356 from trunk Modified: branches/ros-branch-0_3_1/reactos/base/setup/usetup/bootsup.c Modified: branches/ros-branch-0_3_1/reactos/base/setup/usetup/bootsup.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/base/s…
============================================================================== --- branches/ros-branch-0_3_1/reactos/base/setup/usetup/bootsup.c (original) +++ branches/ros-branch-0_3_1/reactos/base/setup/usetup/bootsup.c Wed Oct 4 16:34:53 2006 @@ -1665,6 +1665,7 @@ PINICACHESECTION Section = NULL; NTSTATUS Status; ULONG FileAttribute; + PWCHAR OldValue = NULL; RtlInitUnicodeString(&Name, BootIniPath); @@ -1685,11 +1686,20 @@ return(STATUS_UNSUCCESSFUL); } - IniCacheInsertKey(Section, + /* Check - maybe record already exists */ + Status = IniCacheGetKey(Section, + EntryName, + &OldValue); + + /* If either key was not found, or contains something else - add new one */ + if (!NT_SUCCESS(Status) || wcscmp(OldValue, EntryValue)) + { + IniCacheInsertKey(Section, NULL, INSERT_LAST, EntryName, EntryValue); + } Status = UnprotectBootIni(BootIniPath, &FileAttribute); @@ -1741,311 +1751,311 @@ PUNICODE_STRING DestinationArcPath, UCHAR PartitionType) { - WCHAR SrcPath[MAX_PATH]; - WCHAR DstPath[MAX_PATH]; - NTSTATUS Status; - - /* FAT or FAT32 partition */ - DPRINT1("System path: '%wZ'\n", SystemRootPath); - - if (DoesFileExist(SystemRootPath->Buffer, L"ntldr") == TRUE || - DoesFileExist(SystemRootPath->Buffer, L"boot.ini") == TRUE) - { - /* Search root directory for 'ntldr' and 'boot.ini'. */ - DPRINT("Found Microsoft Windows NT/2000/XP boot loader\n"); - - /* Copy FreeLoader to the boot partition */ - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\freeldr.sys"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.sys"); - - DPRINT("Copy: %S ==> %S\n", SrcPath, DstPath); - Status = SetupCopyFile(SrcPath, DstPath); - if (!NT_SUCCESS(Status)) - { - DPRINT1("SetupCopyFile() failed (Status %lx)\n", Status); - return Status; - } - - /* Create or update freeldr.ini */ - if (DoesFileExist(SystemRootPath->Buffer, L"freeldr.ini") == FALSE) - { - /* Create new 'freeldr.ini' */ - DPRINT1("Create new 'freeldr.ini'\n"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.ini"); - - Status = CreateFreeLoaderIniForReactos(DstPath, - DestinationArcPath->Buffer); - if (!NT_SUCCESS(Status)) + WCHAR SrcPath[MAX_PATH]; + WCHAR DstPath[MAX_PATH]; + NTSTATUS Status; + + /* FAT or FAT32 partition */ + DPRINT1("System path: '%wZ'\n", SystemRootPath); + + if (DoesFileExist(SystemRootPath->Buffer, L"ntldr") == TRUE || + DoesFileExist(SystemRootPath->Buffer, L"boot.ini") == TRUE) { - DPRINT1("CreateFreeLoaderIniForReactos() failed (Status %lx)\n", Status); - return Status; + /* Search root directory for 'ntldr' and 'boot.ini'. */ + DPRINT("Found Microsoft Windows NT/2000/XP boot loader\n"); + + /* Copy FreeLoader to the boot partition */ + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\freeldr.sys"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.sys"); + + DPRINT("Copy: %S ==> %S\n", SrcPath, DstPath); + Status = SetupCopyFile(SrcPath, DstPath); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SetupCopyFile() failed (Status %lx)\n", Status); + return Status; + } + + /* Create or update freeldr.ini */ + if (DoesFileExist(SystemRootPath->Buffer, L"freeldr.ini") == FALSE) + { + /* Create new 'freeldr.ini' */ + DPRINT1("Create new 'freeldr.ini'\n"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.ini"); + + Status = CreateFreeLoaderIniForReactos(DstPath, + DestinationArcPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("CreateFreeLoaderIniForReactos() failed (Status %lx)\n", Status); + return Status; + } + + /* Install new bootcode */ + if (PartitionType == PARTITION_FAT32 || + PartitionType == PARTITION_FAT32_XINT13) + { + /* Install FAT32 bootcode */ + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\fat32.bin"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\bootsect.ros"); + + DPRINT1("Install FAT32 bootcode: %S ==> %S\n", SrcPath, DstPath); + Status = InstallFat32BootCodeToFile(SrcPath, + DstPath, + SystemRootPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("InstallFat32BootCodeToFile() failed (Status %lx)\n", Status); + return Status; + } + } + else + { + /* Install FAT16 bootcode */ + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\fat.bin"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\bootsect.ros"); + + DPRINT1("Install FAT bootcode: %S ==> %S\n", SrcPath, DstPath); + Status = InstallFat16BootCodeToFile(SrcPath, + DstPath, + SystemRootPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("InstallFat16BootCodeToFile() failed (Status %lx)\n", Status); + return Status; + } + } + } + else + { + /* Update existing 'freeldr.ini' */ + DPRINT1("Update existing 'freeldr.ini'\n"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.ini"); + + Status = UpdateFreeLoaderIni(DstPath, + DestinationArcPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("UpdateFreeLoaderIni() failed (Status %lx)\n", Status); + return Status; + } + } + + /* Update 'boot.ini' */ + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\boot.ini"); + + DPRINT1("Update 'boot.ini': %S\n", DstPath); + Status = UpdateBootIni(DstPath, + L"C:\\bootsect.ros", + L"\"ReactOS\""); + if (!NT_SUCCESS(Status)) + { + DPRINT1("UpdateBootIni() failed (Status %lx)\n", Status); + return Status; + } } - - /* Install new bootcode */ - if (PartitionType == PARTITION_FAT32 || - PartitionType == PARTITION_FAT32_XINT13) + else if (DoesFileExist(SystemRootPath->Buffer, L"io.sys") == TRUE || + DoesFileExist(SystemRootPath->Buffer, L"msdos.sys") == TRUE) { - /* Install FAT32 bootcode */ - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\fat32.bin"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\bootsect.ros"); - - DPRINT1("Install FAT32 bootcode: %S ==> %S\n", SrcPath, DstPath); - Status = InstallFat32BootCodeToFile(SrcPath, - DstPath, - SystemRootPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("InstallFat32BootCodeToFile() failed (Status %lx)\n", Status); - return Status; - } + /* Search for root directory for 'io.sys' and 'msdos.sys'. */ + DPRINT1("Found Microsoft DOS or Windows 9x boot loader\n"); + + /* Copy FreeLoader to the boot partition */ + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\freeldr.sys"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.sys"); + + DPRINT("Copy: %S ==> %S\n", SrcPath, DstPath); + Status = SetupCopyFile(SrcPath, DstPath); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SetupCopyFile() failed (Status %lx)\n", Status); + return Status; + } + + /* Create or update 'freeldr.ini' */ + if (DoesFileExist(SystemRootPath->Buffer, L"freeldr.ini") == FALSE) + { + /* Create new 'freeldr.ini' */ + DPRINT1("Create new 'freeldr.ini'\n"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.ini"); + + Status = CreateFreeLoaderIniForDos(DstPath, + DestinationArcPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("CreateFreeLoaderIniForDos() failed (Status %lx)\n", Status); + return Status; + } + + /* Save current bootsector as 'BOOTSECT.DOS' */ + wcscpy(SrcPath, SystemRootPath->Buffer); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\bootsect.dos"); + + DPRINT1("Save bootsector: %S ==> %S\n", SrcPath, DstPath); + Status = SaveCurrentBootSector(SrcPath, + DstPath); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SaveCurrentBootSector() failed (Status %lx)\n", Status); + return Status; + } + + /* Install new bootsector */ + if (PartitionType == PARTITION_FAT32 || + PartitionType == PARTITION_FAT32_XINT13) + { + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\fat32.bin"); + + DPRINT1("Install FAT32 bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); + Status = InstallFat32BootCodeToDisk(SrcPath, + SystemRootPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("InstallFat32BootCodeToDisk() failed (Status %lx)\n", Status); + return Status; + } + } + else + { + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\fat.bin"); + + DPRINT1("Install FAT bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); + Status = InstallFat16BootCodeToDisk(SrcPath, + SystemRootPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("InstallFat16BootCodeToDisk() failed (Status %lx)\n", Status); + return Status; + } + } + } + else + { + /* Update existing 'freeldr.ini' */ + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.ini"); + + Status = UpdateFreeLoaderIni(DstPath, + DestinationArcPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("UpdateFreeLoaderIni() failed (Status %lx)\n", Status); + return Status; + } + } } else { - /* Install FAT16 bootcode */ - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\fat.bin"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\bootsect.ros"); - - DPRINT1("Install FAT bootcode: %S ==> %S\n", SrcPath, DstPath); - Status = InstallFat16BootCodeToFile(SrcPath, - DstPath, - SystemRootPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("InstallFat16BootCodeToFile() failed (Status %lx)\n", Status); - return Status; - } + /* No or unknown boot loader */ + DPRINT1("No or unknown boot loader found\n"); + + /* Copy FreeLoader to the boot partition */ + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\freeldr.sys"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.sys"); + + DPRINT1("Copy: %S ==> %S\n", SrcPath, DstPath); + Status = SetupCopyFile(SrcPath, DstPath); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SetupCopyFile() failed (Status %lx)\n", Status); + return Status; + } + + /* Create or update 'freeldr.ini' */ + if (DoesFileExist(SystemRootPath->Buffer, L"freeldr.ini") == FALSE) + { + /* Create new freeldr.ini */ + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.ini"); + + DPRINT1("Copy: %S ==> %S\n", SrcPath, DstPath); + Status = CreateFreeLoaderIniForReactos(DstPath, + DestinationArcPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("CreateFreeLoaderIniForReactos() failed (Status %lx)\n", Status); + return Status; + } + + /* Save current bootsector as 'BOOTSECT.OLD' */ + wcscpy(SrcPath, SystemRootPath->Buffer); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\bootsect.old"); + + DPRINT1("Save bootsector: %S ==> %S\n", SrcPath, DstPath); + Status = SaveCurrentBootSector(SrcPath, + DstPath); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SaveCurrentBootSector() failed (Status %lx)\n", Status); + return Status; + } + + /* Install new bootsector */ + if (PartitionType == PARTITION_FAT32 || + PartitionType == PARTITION_FAT32_XINT13) + { + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\fat32.bin"); + + DPRINT("Install FAT32 bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); + Status = InstallFat32BootCodeToDisk(SrcPath, + SystemRootPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("InstallFat32BootCodeToDisk() failed (Status %lx)\n", Status); + return Status; + } + } + else + { + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\fat.bin"); + + DPRINT("Install FAT bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); + Status = InstallFat16BootCodeToDisk(SrcPath, + SystemRootPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("InstallFat16BootCodeToDisk() failed (Status %lx)\n", Status); + return Status; + } + } + } + else + { + /* Update existing 'freeldr.ini' */ + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.ini"); + + Status = UpdateFreeLoaderIni(DstPath, + DestinationArcPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("UpdateFreeLoaderIni() failed (Status %lx)\n", Status); + return Status; + } + } } - /* Update 'boot.ini' */ - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\boot.ini"); - - DPRINT1("Update 'boot.ini': %S\n", DstPath); - Status = UpdateBootIni(DstPath, - L"C:\\bootsect.ros", - L"\"ReactOS\""); - if (!NT_SUCCESS(Status)) - { - DPRINT1("UpdateBootIni() failed (Status %lx)\n", Status); - return Status; - } - } - else - { - /* Update existing 'freeldr.ini' */ - DPRINT1("Update existing 'freeldr.ini'\n"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.ini"); - - Status = UpdateFreeLoaderIni(DstPath, - DestinationArcPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("UpdateFreeLoaderIni() failed (Status %lx)\n", Status); - return Status; - } - } - } - else if (DoesFileExist(SystemRootPath->Buffer, L"io.sys") == TRUE || - DoesFileExist(SystemRootPath->Buffer, L"msdos.sys") == TRUE) - { - /* Search for root directory for 'io.sys' and 'msdos.sys'. */ - DPRINT1("Found Microsoft DOS or Windows 9x boot loader\n"); - - /* Copy FreeLoader to the boot partition */ - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\freeldr.sys"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.sys"); - - DPRINT("Copy: %S ==> %S\n", SrcPath, DstPath); - Status = SetupCopyFile(SrcPath, DstPath); - if (!NT_SUCCESS(Status)) - { - DPRINT1("SetupCopyFile() failed (Status %lx)\n", Status); - return Status; - } - - /* Create or update 'freeldr.ini' */ - if (DoesFileExist(SystemRootPath->Buffer, L"freeldr.ini") == FALSE) - { - /* Create new 'freeldr.ini' */ - DPRINT1("Create new 'freeldr.ini'\n"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.ini"); - - Status = CreateFreeLoaderIniForDos(DstPath, - DestinationArcPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("CreateFreeLoaderIniForDos() failed (Status %lx)\n", Status); - return Status; - } - - /* Save current bootsector as 'BOOTSECT.DOS' */ - wcscpy(SrcPath, SystemRootPath->Buffer); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\bootsect.dos"); - - DPRINT1("Save bootsector: %S ==> %S\n", SrcPath, DstPath); - Status = SaveCurrentBootSector(SrcPath, - DstPath); - if (!NT_SUCCESS(Status)) - { - DPRINT1("SaveCurrentBootSector() failed (Status %lx)\n", Status); - return Status; - } - - /* Install new bootsector */ - if (PartitionType == PARTITION_FAT32 || - PartitionType == PARTITION_FAT32_XINT13) - { - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\fat32.bin"); - - DPRINT1("Install FAT32 bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); - Status = InstallFat32BootCodeToDisk(SrcPath, - SystemRootPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("InstallFat32BootCodeToDisk() failed (Status %lx)\n", Status); - return Status; - } - } - else - { - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\fat.bin"); - - DPRINT1("Install FAT bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); - Status = InstallFat16BootCodeToDisk(SrcPath, - SystemRootPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("InstallFat16BootCodeToDisk() failed (Status %lx)\n", Status); - return Status; - } - } - } - else - { - /* Update existing 'freeldr.ini' */ - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.ini"); - - Status = UpdateFreeLoaderIni(DstPath, - DestinationArcPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("UpdateFreeLoaderIni() failed (Status %lx)\n", Status); - return Status; - } - } - } - else - { - /* No or unknown boot loader */ - DPRINT1("No or unknown boot loader found\n"); - - /* Copy FreeLoader to the boot partition */ - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\freeldr.sys"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.sys"); - - DPRINT1("Copy: %S ==> %S\n", SrcPath, DstPath); - Status = SetupCopyFile(SrcPath, DstPath); - if (!NT_SUCCESS(Status)) - { - DPRINT1("SetupCopyFile() failed (Status %lx)\n", Status); - return Status; - } - - /* Create or update 'freeldr.ini' */ - if (DoesFileExist(SystemRootPath->Buffer, L"freeldr.ini") == FALSE) - { - /* Create new freeldr.ini */ - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.ini"); - - DPRINT1("Copy: %S ==> %S\n", SrcPath, DstPath); - Status = CreateFreeLoaderIniForReactos(DstPath, - DestinationArcPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("CreateFreeLoaderIniForReactos() failed (Status %lx)\n", Status); - return Status; - } - - /* Save current bootsector as 'BOOTSECT.OLD' */ - wcscpy(SrcPath, SystemRootPath->Buffer); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\bootsect.old"); - - DPRINT1("Save bootsector: %S ==> %S\n", SrcPath, DstPath); - Status = SaveCurrentBootSector(SrcPath, - DstPath); - if (!NT_SUCCESS(Status)) - { - DPRINT1("SaveCurrentBootSector() failed (Status %lx)\n", Status); - return Status; - } - - /* Install new bootsector */ - if (PartitionType == PARTITION_FAT32 || - PartitionType == PARTITION_FAT32_XINT13) - { - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\fat32.bin"); - - DPRINT("Install FAT32 bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); - Status = InstallFat32BootCodeToDisk(SrcPath, - SystemRootPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("InstallFat32BootCodeToDisk() failed (Status %lx)\n", Status); - return Status; - } - } - else - { - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\fat.bin"); - - DPRINT("Install FAT bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); - Status = InstallFat16BootCodeToDisk(SrcPath, - SystemRootPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("InstallFat16BootCodeToDisk() failed (Status %lx)\n", Status); - return Status; - } - } - } - else - { - /* Update existing 'freeldr.ini' */ - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.ini"); - - Status = UpdateFreeLoaderIni(DstPath, - DestinationArcPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("UpdateFreeLoaderIni() failed (Status %lx)\n", Status); - return Status; - } - } - } - - return STATUS_SUCCESS; + return STATUS_SUCCESS; }
18 years, 2 months
1
0
0
0
[fireball] 24392: - Format code of InstallFatBootcodeToPartition(), changing from tabs+spaces mix to tabs only (use "ignore whitespaces" settings to view other changes) - Change installation logic when installing to a NTLDR's boot.ini: Firstly freeldr.ini is checked for existence, and either created or updated, then boot.ini is checked for having a proper entry, and if needed - entry is added. Fixes related bugs (having more and more ReactOS entries, no entry added if freeldr.ini already exists
by fireball@svn.reactos.org
Author: fireball Date: Wed Oct 4 16:26:12 2006 New Revision: 24392 URL:
http://svn.reactos.org/svn/reactos?rev=24392&view=rev
Log: - Format code of InstallFatBootcodeToPartition(), changing from tabs+spaces mix to tabs only (use "ignore whitespaces" settings to view other changes) - Change installation logic when installing to a NTLDR's boot.ini: Firstly freeldr.ini is checked for existence, and either created or updated, then boot.ini is checked for having a proper entry, and if needed - entry is added. Fixes related bugs (having more and more ReactOS entries, no entry added if freeldr.ini already exists in the root folder) Modified: trunk/reactos/base/setup/usetup/bootsup.c Modified: trunk/reactos/base/setup/usetup/bootsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/bootsup.…
============================================================================== --- trunk/reactos/base/setup/usetup/bootsup.c (original) +++ trunk/reactos/base/setup/usetup/bootsup.c Wed Oct 4 16:26:12 2006 @@ -1751,311 +1751,311 @@ PUNICODE_STRING DestinationArcPath, UCHAR PartitionType) { - WCHAR SrcPath[MAX_PATH]; - WCHAR DstPath[MAX_PATH]; - NTSTATUS Status; - - /* FAT or FAT32 partition */ - DPRINT1("System path: '%wZ'\n", SystemRootPath); - - if (DoesFileExist(SystemRootPath->Buffer, L"ntldr") == TRUE || - DoesFileExist(SystemRootPath->Buffer, L"boot.ini") == TRUE) - { - /* Search root directory for 'ntldr' and 'boot.ini'. */ - DPRINT("Found Microsoft Windows NT/2000/XP boot loader\n"); - - /* Copy FreeLoader to the boot partition */ - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\freeldr.sys"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.sys"); - - DPRINT("Copy: %S ==> %S\n", SrcPath, DstPath); - Status = SetupCopyFile(SrcPath, DstPath); - if (!NT_SUCCESS(Status)) - { - DPRINT1("SetupCopyFile() failed (Status %lx)\n", Status); - return Status; - } - - /* Create or update freeldr.ini */ - if (DoesFileExist(SystemRootPath->Buffer, L"freeldr.ini") == FALSE) - { - /* Create new 'freeldr.ini' */ - DPRINT1("Create new 'freeldr.ini'\n"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.ini"); - - Status = CreateFreeLoaderIniForReactos(DstPath, - DestinationArcPath->Buffer); - if (!NT_SUCCESS(Status)) + WCHAR SrcPath[MAX_PATH]; + WCHAR DstPath[MAX_PATH]; + NTSTATUS Status; + + /* FAT or FAT32 partition */ + DPRINT1("System path: '%wZ'\n", SystemRootPath); + + if (DoesFileExist(SystemRootPath->Buffer, L"ntldr") == TRUE || + DoesFileExist(SystemRootPath->Buffer, L"boot.ini") == TRUE) { - DPRINT1("CreateFreeLoaderIniForReactos() failed (Status %lx)\n", Status); - return Status; + /* Search root directory for 'ntldr' and 'boot.ini'. */ + DPRINT("Found Microsoft Windows NT/2000/XP boot loader\n"); + + /* Copy FreeLoader to the boot partition */ + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\freeldr.sys"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.sys"); + + DPRINT("Copy: %S ==> %S\n", SrcPath, DstPath); + Status = SetupCopyFile(SrcPath, DstPath); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SetupCopyFile() failed (Status %lx)\n", Status); + return Status; + } + + /* Create or update freeldr.ini */ + if (DoesFileExist(SystemRootPath->Buffer, L"freeldr.ini") == FALSE) + { + /* Create new 'freeldr.ini' */ + DPRINT1("Create new 'freeldr.ini'\n"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.ini"); + + Status = CreateFreeLoaderIniForReactos(DstPath, + DestinationArcPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("CreateFreeLoaderIniForReactos() failed (Status %lx)\n", Status); + return Status; + } + + /* Install new bootcode */ + if (PartitionType == PARTITION_FAT32 || + PartitionType == PARTITION_FAT32_XINT13) + { + /* Install FAT32 bootcode */ + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\fat32.bin"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\bootsect.ros"); + + DPRINT1("Install FAT32 bootcode: %S ==> %S\n", SrcPath, DstPath); + Status = InstallFat32BootCodeToFile(SrcPath, + DstPath, + SystemRootPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("InstallFat32BootCodeToFile() failed (Status %lx)\n", Status); + return Status; + } + } + else + { + /* Install FAT16 bootcode */ + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\fat.bin"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\bootsect.ros"); + + DPRINT1("Install FAT bootcode: %S ==> %S\n", SrcPath, DstPath); + Status = InstallFat16BootCodeToFile(SrcPath, + DstPath, + SystemRootPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("InstallFat16BootCodeToFile() failed (Status %lx)\n", Status); + return Status; + } + } + } + else + { + /* Update existing 'freeldr.ini' */ + DPRINT1("Update existing 'freeldr.ini'\n"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.ini"); + + Status = UpdateFreeLoaderIni(DstPath, + DestinationArcPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("UpdateFreeLoaderIni() failed (Status %lx)\n", Status); + return Status; + } + } + + /* Update 'boot.ini' */ + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\boot.ini"); + + DPRINT1("Update 'boot.ini': %S\n", DstPath); + Status = UpdateBootIni(DstPath, + L"C:\\bootsect.ros", + L"\"ReactOS\""); + if (!NT_SUCCESS(Status)) + { + DPRINT1("UpdateBootIni() failed (Status %lx)\n", Status); + return Status; + } } - - /* Install new bootcode */ - if (PartitionType == PARTITION_FAT32 || - PartitionType == PARTITION_FAT32_XINT13) + else if (DoesFileExist(SystemRootPath->Buffer, L"io.sys") == TRUE || + DoesFileExist(SystemRootPath->Buffer, L"msdos.sys") == TRUE) { - /* Install FAT32 bootcode */ - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\fat32.bin"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\bootsect.ros"); - - DPRINT1("Install FAT32 bootcode: %S ==> %S\n", SrcPath, DstPath); - Status = InstallFat32BootCodeToFile(SrcPath, - DstPath, - SystemRootPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("InstallFat32BootCodeToFile() failed (Status %lx)\n", Status); - return Status; - } + /* Search for root directory for 'io.sys' and 'msdos.sys'. */ + DPRINT1("Found Microsoft DOS or Windows 9x boot loader\n"); + + /* Copy FreeLoader to the boot partition */ + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\freeldr.sys"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.sys"); + + DPRINT("Copy: %S ==> %S\n", SrcPath, DstPath); + Status = SetupCopyFile(SrcPath, DstPath); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SetupCopyFile() failed (Status %lx)\n", Status); + return Status; + } + + /* Create or update 'freeldr.ini' */ + if (DoesFileExist(SystemRootPath->Buffer, L"freeldr.ini") == FALSE) + { + /* Create new 'freeldr.ini' */ + DPRINT1("Create new 'freeldr.ini'\n"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.ini"); + + Status = CreateFreeLoaderIniForDos(DstPath, + DestinationArcPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("CreateFreeLoaderIniForDos() failed (Status %lx)\n", Status); + return Status; + } + + /* Save current bootsector as 'BOOTSECT.DOS' */ + wcscpy(SrcPath, SystemRootPath->Buffer); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\bootsect.dos"); + + DPRINT1("Save bootsector: %S ==> %S\n", SrcPath, DstPath); + Status = SaveCurrentBootSector(SrcPath, + DstPath); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SaveCurrentBootSector() failed (Status %lx)\n", Status); + return Status; + } + + /* Install new bootsector */ + if (PartitionType == PARTITION_FAT32 || + PartitionType == PARTITION_FAT32_XINT13) + { + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\fat32.bin"); + + DPRINT1("Install FAT32 bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); + Status = InstallFat32BootCodeToDisk(SrcPath, + SystemRootPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("InstallFat32BootCodeToDisk() failed (Status %lx)\n", Status); + return Status; + } + } + else + { + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\fat.bin"); + + DPRINT1("Install FAT bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); + Status = InstallFat16BootCodeToDisk(SrcPath, + SystemRootPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("InstallFat16BootCodeToDisk() failed (Status %lx)\n", Status); + return Status; + } + } + } + else + { + /* Update existing 'freeldr.ini' */ + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.ini"); + + Status = UpdateFreeLoaderIni(DstPath, + DestinationArcPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("UpdateFreeLoaderIni() failed (Status %lx)\n", Status); + return Status; + } + } } else { - /* Install FAT16 bootcode */ - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\fat.bin"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\bootsect.ros"); - - DPRINT1("Install FAT bootcode: %S ==> %S\n", SrcPath, DstPath); - Status = InstallFat16BootCodeToFile(SrcPath, - DstPath, - SystemRootPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("InstallFat16BootCodeToFile() failed (Status %lx)\n", Status); - return Status; - } + /* No or unknown boot loader */ + DPRINT1("No or unknown boot loader found\n"); + + /* Copy FreeLoader to the boot partition */ + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\freeldr.sys"); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.sys"); + + DPRINT1("Copy: %S ==> %S\n", SrcPath, DstPath); + Status = SetupCopyFile(SrcPath, DstPath); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SetupCopyFile() failed (Status %lx)\n", Status); + return Status; + } + + /* Create or update 'freeldr.ini' */ + if (DoesFileExist(SystemRootPath->Buffer, L"freeldr.ini") == FALSE) + { + /* Create new freeldr.ini */ + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.ini"); + + DPRINT1("Copy: %S ==> %S\n", SrcPath, DstPath); + Status = CreateFreeLoaderIniForReactos(DstPath, + DestinationArcPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("CreateFreeLoaderIniForReactos() failed (Status %lx)\n", Status); + return Status; + } + + /* Save current bootsector as 'BOOTSECT.OLD' */ + wcscpy(SrcPath, SystemRootPath->Buffer); + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\bootsect.old"); + + DPRINT1("Save bootsector: %S ==> %S\n", SrcPath, DstPath); + Status = SaveCurrentBootSector(SrcPath, + DstPath); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SaveCurrentBootSector() failed (Status %lx)\n", Status); + return Status; + } + + /* Install new bootsector */ + if (PartitionType == PARTITION_FAT32 || + PartitionType == PARTITION_FAT32_XINT13) + { + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\fat32.bin"); + + DPRINT("Install FAT32 bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); + Status = InstallFat32BootCodeToDisk(SrcPath, + SystemRootPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("InstallFat32BootCodeToDisk() failed (Status %lx)\n", Status); + return Status; + } + } + else + { + wcscpy(SrcPath, SourceRootPath->Buffer); + wcscat(SrcPath, L"\\loader\\fat.bin"); + + DPRINT("Install FAT bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); + Status = InstallFat16BootCodeToDisk(SrcPath, + SystemRootPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("InstallFat16BootCodeToDisk() failed (Status %lx)\n", Status); + return Status; + } + } + } + else + { + /* Update existing 'freeldr.ini' */ + wcscpy(DstPath, SystemRootPath->Buffer); + wcscat(DstPath, L"\\freeldr.ini"); + + Status = UpdateFreeLoaderIni(DstPath, + DestinationArcPath->Buffer); + if (!NT_SUCCESS(Status)) + { + DPRINT1("UpdateFreeLoaderIni() failed (Status %lx)\n", Status); + return Status; + } + } } - /* Update 'boot.ini' */ - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\boot.ini"); - - DPRINT1("Update 'boot.ini': %S\n", DstPath); - Status = UpdateBootIni(DstPath, - L"C:\\bootsect.ros", - L"\"ReactOS\""); - if (!NT_SUCCESS(Status)) - { - DPRINT1("UpdateBootIni() failed (Status %lx)\n", Status); - return Status; - } - } - else - { - /* Update existing 'freeldr.ini' */ - DPRINT1("Update existing 'freeldr.ini'\n"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.ini"); - - Status = UpdateFreeLoaderIni(DstPath, - DestinationArcPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("UpdateFreeLoaderIni() failed (Status %lx)\n", Status); - return Status; - } - } - } - else if (DoesFileExist(SystemRootPath->Buffer, L"io.sys") == TRUE || - DoesFileExist(SystemRootPath->Buffer, L"msdos.sys") == TRUE) - { - /* Search for root directory for 'io.sys' and 'msdos.sys'. */ - DPRINT1("Found Microsoft DOS or Windows 9x boot loader\n"); - - /* Copy FreeLoader to the boot partition */ - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\freeldr.sys"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.sys"); - - DPRINT("Copy: %S ==> %S\n", SrcPath, DstPath); - Status = SetupCopyFile(SrcPath, DstPath); - if (!NT_SUCCESS(Status)) - { - DPRINT1("SetupCopyFile() failed (Status %lx)\n", Status); - return Status; - } - - /* Create or update 'freeldr.ini' */ - if (DoesFileExist(SystemRootPath->Buffer, L"freeldr.ini") == FALSE) - { - /* Create new 'freeldr.ini' */ - DPRINT1("Create new 'freeldr.ini'\n"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.ini"); - - Status = CreateFreeLoaderIniForDos(DstPath, - DestinationArcPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("CreateFreeLoaderIniForDos() failed (Status %lx)\n", Status); - return Status; - } - - /* Save current bootsector as 'BOOTSECT.DOS' */ - wcscpy(SrcPath, SystemRootPath->Buffer); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\bootsect.dos"); - - DPRINT1("Save bootsector: %S ==> %S\n", SrcPath, DstPath); - Status = SaveCurrentBootSector(SrcPath, - DstPath); - if (!NT_SUCCESS(Status)) - { - DPRINT1("SaveCurrentBootSector() failed (Status %lx)\n", Status); - return Status; - } - - /* Install new bootsector */ - if (PartitionType == PARTITION_FAT32 || - PartitionType == PARTITION_FAT32_XINT13) - { - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\fat32.bin"); - - DPRINT1("Install FAT32 bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); - Status = InstallFat32BootCodeToDisk(SrcPath, - SystemRootPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("InstallFat32BootCodeToDisk() failed (Status %lx)\n", Status); - return Status; - } - } - else - { - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\fat.bin"); - - DPRINT1("Install FAT bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); - Status = InstallFat16BootCodeToDisk(SrcPath, - SystemRootPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("InstallFat16BootCodeToDisk() failed (Status %lx)\n", Status); - return Status; - } - } - } - else - { - /* Update existing 'freeldr.ini' */ - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.ini"); - - Status = UpdateFreeLoaderIni(DstPath, - DestinationArcPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("UpdateFreeLoaderIni() failed (Status %lx)\n", Status); - return Status; - } - } - } - else - { - /* No or unknown boot loader */ - DPRINT1("No or unknown boot loader found\n"); - - /* Copy FreeLoader to the boot partition */ - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\freeldr.sys"); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.sys"); - - DPRINT1("Copy: %S ==> %S\n", SrcPath, DstPath); - Status = SetupCopyFile(SrcPath, DstPath); - if (!NT_SUCCESS(Status)) - { - DPRINT1("SetupCopyFile() failed (Status %lx)\n", Status); - return Status; - } - - /* Create or update 'freeldr.ini' */ - if (DoesFileExist(SystemRootPath->Buffer, L"freeldr.ini") == FALSE) - { - /* Create new freeldr.ini */ - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.ini"); - - DPRINT1("Copy: %S ==> %S\n", SrcPath, DstPath); - Status = CreateFreeLoaderIniForReactos(DstPath, - DestinationArcPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("CreateFreeLoaderIniForReactos() failed (Status %lx)\n", Status); - return Status; - } - - /* Save current bootsector as 'BOOTSECT.OLD' */ - wcscpy(SrcPath, SystemRootPath->Buffer); - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\bootsect.old"); - - DPRINT1("Save bootsector: %S ==> %S\n", SrcPath, DstPath); - Status = SaveCurrentBootSector(SrcPath, - DstPath); - if (!NT_SUCCESS(Status)) - { - DPRINT1("SaveCurrentBootSector() failed (Status %lx)\n", Status); - return Status; - } - - /* Install new bootsector */ - if (PartitionType == PARTITION_FAT32 || - PartitionType == PARTITION_FAT32_XINT13) - { - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\fat32.bin"); - - DPRINT("Install FAT32 bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); - Status = InstallFat32BootCodeToDisk(SrcPath, - SystemRootPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("InstallFat32BootCodeToDisk() failed (Status %lx)\n", Status); - return Status; - } - } - else - { - wcscpy(SrcPath, SourceRootPath->Buffer); - wcscat(SrcPath, L"\\loader\\fat.bin"); - - DPRINT("Install FAT bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer); - Status = InstallFat16BootCodeToDisk(SrcPath, - SystemRootPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("InstallFat16BootCodeToDisk() failed (Status %lx)\n", Status); - return Status; - } - } - } - else - { - /* Update existing 'freeldr.ini' */ - wcscpy(DstPath, SystemRootPath->Buffer); - wcscat(DstPath, L"\\freeldr.ini"); - - Status = UpdateFreeLoaderIni(DstPath, - DestinationArcPath->Buffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("UpdateFreeLoaderIni() failed (Status %lx)\n", Status); - return Status; - } - } - } - - return STATUS_SUCCESS; + return STATUS_SUCCESS; }
18 years, 2 months
1
0
0
0
[greatlrd] 24391: this file some have forget set eol-style native fixed
by greatlrd@svn.reactos.org
Author: greatlrd Date: Wed Oct 4 14:59:01 2006 New Revision: 24391 URL:
http://svn.reactos.org/svn/reactos?rev=24391&view=rev
Log: this file some have forget set eol-style native fixed Modified: trunk/reactos/base/applications/winefile/lang/Cs.rc (contents, props changed) trunk/reactos/base/applications/winefile/lang/Pl.rc (contents, props changed) trunk/reactos/base/applications/winefile/lang/Sv.rc (contents, props changed) Modified: trunk/reactos/base/applications/winefile/lang/Cs.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
============================================================================== --- trunk/reactos/base/applications/winefile/lang/Cs.rc (original) +++ trunk/reactos/base/applications/winefile/lang/Cs.rc Wed Oct 4 14:59:01 2006 @@ -1,212 +1,212 @@ -/* - * WineFile - * Czech Language Support - * - * Copyright 2000 Martin Fuchs - * Copyright 2002 Steven Edwards - * Copyright 2002 Alexandre Julliard - * Copyright 2004 David Kredba - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -LANGUAGE LANG_CZECH, SUBLANG_DEFAULT -#pragma code_page(1250) - - -/* Menu */ - -IDM_WINEFILE MENU FIXED IMPURE -{ - POPUP "&Soubor" { - MENUITEM "&Otevøít\tEnter", ID_ACTIVATE - MENUITEM "&Pøesunout...\tF7", ID_FILE_MOVE - MENUITEM "&Kopírovat...\tF8", ID_FILE_COPY - MENUITEM "&Ve schránce...\tF9", 118 - MENUITEM "&Smazat\tDel", ID_FILE_DELETE - MENUITEM "Pø&ejmenovat...", 109 - MENUITEM "V&lastnosti...\tAlt+Enter", ID_EDIT_PROPERTIES - MENUITEM SEPARATOR - MENUITEM "&Komprese...", 119 - MENUITEM "&Dekomprese...", 120 - MENUITEM SEPARATOR - MENUITEM "&Spustit...", ID_EXECUTE - MENUITEM "&Tisknout...", 102 - MENUITEM "Asociovat...", 103 - MENUITEM SEPARATOR - MENUITEM "V&ytvoøit adresáø...", 111 - MENUITEM "&Hledat...", 104 - MENUITEM "&Zvolit voubory...", 116 - MENUITEM SEPARATOR -#ifndef _NO_EXTENSIONS - MENUITEM "K&onec\tAlt+X", ID_FILE_EXIT -#else - MENUITEM "K&onec", ID_FILE_EXIT -#endif - } - - POPUP "&Disk" { - MENUITEM "&Kopírovat disk...", 201 - MENUITEM "&Jmenovka disk...", 202 - MENUITEM SEPARATOR - MENUITEM "&Formátovat disk...", ID_FORMAT_DISK -#ifdef _WIN95 - MENUITEM "&Vytvoøit systemový disk...", -1 /*TODO*/ -#endif - MENUITEM SEPARATOR - MENUITEM "Pøipojit &síové zaøízení", ID_CONNECT_NETWORK_DRIVE - MENUITEM "&Odpojit &síové zaøízení", ID_DISCONNECT_NETWORK_DRIVE - MENUITEM SEPARATOR - MENUITEM "Sdílet jako...", 254 - MENUITEM "&Odstranit sdílení...", 255 - MENUITEM SEPARATOR - MENUITEM "&Zvolit zaøízení...", 251 - } - - POPUP "&Adresáøe" { - MENUITEM "&Dalí úroveò\t+", 301 - MENUITEM "Rozbalit &strom\t*", 302 - MENUITEM "Rozbalit &ve\tStrg+*", 303 - MENUITEM "Sbalit &strom\t-", 304 - MENUITEM SEPARATOR - MENUITEM "&Oznaèit potomky", 505 - } - - POPUP "&Zobrazení" { - MENUITEM "&Strom a adresáøe", 413 - MENUITEM "&Jen strom", 411 - MENUITEM "Jen &adresáøe", 412 - MENUITEM SEPARATOR - MENUITEM "&Rozdìlit", ID_VIEW_SPLIT - MENUITEM SEPARATOR - MENUITEM "&Jméno", ID_VIEW_NAME - MENUITEM "&Detaily vech souborù", ID_VIEW_ALL_ATTRIBUTES, CHECKED - MENUITEM "Èá&steèné detaily...", ID_VIEW_SELECTED_ATTRIBUTES - MENUITEM SEPARATOR - MENUITEM "&Tøídit podle jména", ID_VIEW_SORT_NAME - MENUITEM "Tøídit &podle typu", ID_VIEW_SORT_TYPE - MENUITEM "Tøídit podle &velikosti", ID_VIEW_SORT_SIZE - MENUITEM "Tøídit podle &data", ID_VIEW_SORT_DATE - MENUITEM SEPARATOR - MENUITEM "Tøídit podle &...", ID_VIEW_FILTER - } - - POPUP "&Nastavení" { - MENUITEM "&Potvrzování...", 501 - MENUITEM "&Písmo...", ID_SELECT_FONT - MENUITEM "Upravit panel &nástrojù...", 512 - MENUITEM SEPARATOR - MENUITEM "&Panel nástrojù", ID_VIEW_TOOL_BAR, CHECKED - MENUITEM "&Panel zaøíení", ID_VIEW_DRIVE_BAR, CHECKED - MENUITEM "&Stavový øádek", ID_VIEW_STATUSBAR, CHECKED -#ifndef _NO_EXTENSIONS - MENUITEM "&Celaá obrazovka\tCtrl+Shift+S", ID_VIEW_FULLSCREEN -#endif - MENUITEM SEPARATOR - MENUITEM "&Minimalizovat pøi sputìní", 504 - MENUITEM "&Uloit nastavení pøi vypnutí",511 - } - - - POPUP "&Zabezpeèení" { - MENUITEM "&Pøístup...", 605 - MENUITEM "&Logování...", 606 - MENUITEM "&Vlastník...", 607 - } - - POPUP "&Okno" { - MENUITEM "Nové &okno", ID_WINDOW_NEW - MENUITEM "Kaskádování\tCtrl+F5", ID_WINDOW_CASCADE - MENUITEM "Uspoøádat &horizontálnì", ID_WINDOW_TILE_HORZ - MENUITEM "Uspoøádat &vertikálnì\tCtrl+F4",ID_WINDOW_TILE_VERT -#ifndef _NO_EXTENSIONS - MENUITEM "Zarovnat automaticky", ID_WINDOW_AUTOSORT -#endif - MENUITEM "Zarovnat &symboly", ID_WINDOW_ARRANGE - MENUITEM "&Aktualizovat\tF5", ID_REFRESH - } - - POPUP "&?" { - MENUITEM "&Témata nápovìdy\tF1", ID_HELP - MENUITEM "Hledání v &nápovìdì...\tF1", ID_HELP - MENUITEM "&Jak pouívat nápovìdu\tF1", ID_HELP_USING - MENUITEM SEPARATOR - MENUITEM "&Informace o Winefile...", ID_ABOUT -#ifdef __WINE__ - MENUITEM "Informace o &Wine...", ID_ABOUT_WINE -#endif - } -} - - -IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Spustit" -FONT 8, "MS Shell Dlg" -{ - CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 - CONTROL "&Pøíkaz:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 - EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL - CONTROL "Jako &Symbol", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12 - DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 - PUSHBUTTON "Zruit", 2, 158, 23, 47, 14 - PUSHBUTTON "&Pomoc", 254, 158, 43, 47, 14 -} - -IDD_SELECT_DESTINATION DIALOG FIXED IMPURE 15, 13, 210, 63 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Zvolte cíl" -FONT 8, "MS Shell Dlg" -{ - CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 - CONTROL "&Cesta:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 - EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 - PUSHBUTTON "Zruit", 2, 158, 23, 47, 14 - PUSHBUTTON "&Procházet", 254, 158, 43, 47, 14 -} - -STRINGTABLE -{ - IDS_FONT_SEL_DLG_NAME "Aplikování nastavení písma" - IDS_FONT_SEL_ERROR "Chyba pøi volbì nového písma." -} - -STRINGTABLE -{ - IDS_WINEFILE "Winefile" - IDS_ERROR "Chyba" - IDS_ROOT_FS "root fs" - IDS_UNIXFS "unixfs" - IDS_DESKTOP "Plocha" - IDS_SHELL "Pøíkazový øádek" - IDS_TITLEFMT "%s - %s" - IDS_NO_IMPL "Zatím neimplementováno" - IDS_WINE "WINE" - IDS_WINE_FILE "Wine File" -} - -STRINGTABLE -{ - IDS_COL_NAME "Jméno" - IDS_COL_SIZE "Velikost" - IDS_COL_CDATE "Datum vytvoøení" - IDS_COL_ADATE "Datum posledního pøístupu" - IDS_COL_MDATE "Datum poslední modifikace" - IDS_COL_IDX "Index/Inode" - IDS_COL_LINKS "Linky" - IDS_COL_ATTR "Atributy" - IDS_COL_SEC "Zabezpeèení" -} +/* + * WineFile + * Czech Language Support + * + * Copyright 2000 Martin Fuchs + * Copyright 2002 Steven Edwards + * Copyright 2002 Alexandre Julliard + * Copyright 2004 David Kredba + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_CZECH, SUBLANG_DEFAULT +#pragma code_page(1250) + + +/* Menu */ + +IDM_WINEFILE MENU FIXED IMPURE +{ + POPUP "&Soubor" { + MENUITEM "&Otevøít\tEnter", ID_ACTIVATE + MENUITEM "&Pøesunout...\tF7", ID_FILE_MOVE + MENUITEM "&Kopírovat...\tF8", ID_FILE_COPY + MENUITEM "&Ve schránce...\tF9", 118 + MENUITEM "&Smazat\tDel", ID_FILE_DELETE + MENUITEM "Pø&ejmenovat...", 109 + MENUITEM "V&lastnosti...\tAlt+Enter", ID_EDIT_PROPERTIES + MENUITEM SEPARATOR + MENUITEM "&Komprese...", 119 + MENUITEM "&Dekomprese...", 120 + MENUITEM SEPARATOR + MENUITEM "&Spustit...", ID_EXECUTE + MENUITEM "&Tisknout...", 102 + MENUITEM "Asociovat...", 103 + MENUITEM SEPARATOR + MENUITEM "V&ytvoøit adresáø...", 111 + MENUITEM "&Hledat...", 104 + MENUITEM "&Zvolit voubory...", 116 + MENUITEM SEPARATOR +#ifndef _NO_EXTENSIONS + MENUITEM "K&onec\tAlt+X", ID_FILE_EXIT +#else + MENUITEM "K&onec", ID_FILE_EXIT +#endif + } + + POPUP "&Disk" { + MENUITEM "&Kopírovat disk...", 201 + MENUITEM "&Jmenovka disk...", 202 + MENUITEM SEPARATOR + MENUITEM "&Formátovat disk...", ID_FORMAT_DISK +#ifdef _WIN95 + MENUITEM "&Vytvoøit systemový disk...", -1 /*TODO*/ +#endif + MENUITEM SEPARATOR + MENUITEM "Pøipojit &síové zaøízení", ID_CONNECT_NETWORK_DRIVE + MENUITEM "&Odpojit &síové zaøízení", ID_DISCONNECT_NETWORK_DRIVE + MENUITEM SEPARATOR + MENUITEM "Sdílet jako...", 254 + MENUITEM "&Odstranit sdílení...", 255 + MENUITEM SEPARATOR + MENUITEM "&Zvolit zaøízení...", 251 + } + + POPUP "&Adresáøe" { + MENUITEM "&Dalí úroveò\t+", 301 + MENUITEM "Rozbalit &strom\t*", 302 + MENUITEM "Rozbalit &ve\tStrg+*", 303 + MENUITEM "Sbalit &strom\t-", 304 + MENUITEM SEPARATOR + MENUITEM "&Oznaèit potomky", 505 + } + + POPUP "&Zobrazení" { + MENUITEM "&Strom a adresáøe", 413 + MENUITEM "&Jen strom", 411 + MENUITEM "Jen &adresáøe", 412 + MENUITEM SEPARATOR + MENUITEM "&Rozdìlit", ID_VIEW_SPLIT + MENUITEM SEPARATOR + MENUITEM "&Jméno", ID_VIEW_NAME + MENUITEM "&Detaily vech souborù", ID_VIEW_ALL_ATTRIBUTES, CHECKED + MENUITEM "Èá&steèné detaily...", ID_VIEW_SELECTED_ATTRIBUTES + MENUITEM SEPARATOR + MENUITEM "&Tøídit podle jména", ID_VIEW_SORT_NAME + MENUITEM "Tøídit &podle typu", ID_VIEW_SORT_TYPE + MENUITEM "Tøídit podle &velikosti", ID_VIEW_SORT_SIZE + MENUITEM "Tøídit podle &data", ID_VIEW_SORT_DATE + MENUITEM SEPARATOR + MENUITEM "Tøídit podle &...", ID_VIEW_FILTER + } + + POPUP "&Nastavení" { + MENUITEM "&Potvrzování...", 501 + MENUITEM "&Písmo...", ID_SELECT_FONT + MENUITEM "Upravit panel &nástrojù...", 512 + MENUITEM SEPARATOR + MENUITEM "&Panel nástrojù", ID_VIEW_TOOL_BAR, CHECKED + MENUITEM "&Panel zaøíení", ID_VIEW_DRIVE_BAR, CHECKED + MENUITEM "&Stavový øádek", ID_VIEW_STATUSBAR, CHECKED +#ifndef _NO_EXTENSIONS + MENUITEM "&Celaá obrazovka\tCtrl+Shift+S", ID_VIEW_FULLSCREEN +#endif + MENUITEM SEPARATOR + MENUITEM "&Minimalizovat pøi sputìní", 504 + MENUITEM "&Uloit nastavení pøi vypnutí",511 + } + + + POPUP "&Zabezpeèení" { + MENUITEM "&Pøístup...", 605 + MENUITEM "&Logování...", 606 + MENUITEM "&Vlastník...", 607 + } + + POPUP "&Okno" { + MENUITEM "Nové &okno", ID_WINDOW_NEW + MENUITEM "Kaskádování\tCtrl+F5", ID_WINDOW_CASCADE + MENUITEM "Uspoøádat &horizontálnì", ID_WINDOW_TILE_HORZ + MENUITEM "Uspoøádat &vertikálnì\tCtrl+F4",ID_WINDOW_TILE_VERT +#ifndef _NO_EXTENSIONS + MENUITEM "Zarovnat automaticky", ID_WINDOW_AUTOSORT +#endif + MENUITEM "Zarovnat &symboly", ID_WINDOW_ARRANGE + MENUITEM "&Aktualizovat\tF5", ID_REFRESH + } + + POPUP "&?" { + MENUITEM "&Témata nápovìdy\tF1", ID_HELP + MENUITEM "Hledání v &nápovìdì...\tF1", ID_HELP + MENUITEM "&Jak pouívat nápovìdu\tF1", ID_HELP_USING + MENUITEM SEPARATOR + MENUITEM "&Informace o Winefile...", ID_ABOUT +#ifdef __WINE__ + MENUITEM "Informace o &Wine...", ID_ABOUT_WINE +#endif + } +} + + +IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Spustit" +FONT 8, "MS Shell Dlg" +{ + CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 + CONTROL "&Pøíkaz:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 + EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL + CONTROL "Jako &Symbol", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12 + DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 + PUSHBUTTON "Zruit", 2, 158, 23, 47, 14 + PUSHBUTTON "&Pomoc", 254, 158, 43, 47, 14 +} + +IDD_SELECT_DESTINATION DIALOG FIXED IMPURE 15, 13, 210, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Zvolte cíl" +FONT 8, "MS Shell Dlg" +{ + CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 + CONTROL "&Cesta:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 + EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL + DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 + PUSHBUTTON "Zruit", 2, 158, 23, 47, 14 + PUSHBUTTON "&Procházet", 254, 158, 43, 47, 14 +} + +STRINGTABLE +{ + IDS_FONT_SEL_DLG_NAME "Aplikování nastavení písma" + IDS_FONT_SEL_ERROR "Chyba pøi volbì nového písma." +} + +STRINGTABLE +{ + IDS_WINEFILE "Winefile" + IDS_ERROR "Chyba" + IDS_ROOT_FS "root fs" + IDS_UNIXFS "unixfs" + IDS_DESKTOP "Plocha" + IDS_SHELL "Pøíkazový øádek" + IDS_TITLEFMT "%s - %s" + IDS_NO_IMPL "Zatím neimplementováno" + IDS_WINE "WINE" + IDS_WINE_FILE "Wine File" +} + +STRINGTABLE +{ + IDS_COL_NAME "Jméno" + IDS_COL_SIZE "Velikost" + IDS_COL_CDATE "Datum vytvoøení" + IDS_COL_ADATE "Datum posledního pøístupu" + IDS_COL_MDATE "Datum poslední modifikace" + IDS_COL_IDX "Index/Inode" + IDS_COL_LINKS "Linky" + IDS_COL_ATTR "Atributy" + IDS_COL_SEC "Zabezpeèení" +} Propchange: trunk/reactos/base/applications/winefile/lang/Cs.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/winefile/lang/Pl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
============================================================================== --- trunk/reactos/base/applications/winefile/lang/Pl.rc (original) +++ trunk/reactos/base/applications/winefile/lang/Pl.rc Wed Oct 4 14:59:01 2006 @@ -1,183 +1,183 @@ -/* - * WineFile - * Polish Language Support - * - * Copyright 2000 Martin Fuchs - * Copyright 2002 Steven Edwards - * Copyright 2002 Alexandre Julliard - * Copyright 2004 Piotr Caban - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -LANGUAGE LANG_POLISH, SUBLANG_DEFAULT - -/* Menu */ - -IDM_WINEFILE MENU FIXED IMPURE -{ - POPUP "&Plik" { - MENUITEM "&Otwórz\tEnter", ID_ACTIVATE - MENUITEM "&Przenie...\tF7", ID_FILE_MOVE - MENUITEM "&Kopiuj...\tF8", ID_FILE_COPY - MENUITEM "W s&chowku...\tF9", 118 - MENUITEM "&Usuñ\tDel", ID_FILE_DELETE - MENUITEM "&Zmieñ nazwê...", 109 - MENUITEM "Ustawie&nia...\tAlt+Enter", ID_EDIT_PROPERTIES - MENUITEM SEPARATOR - MENUITEM "&Kompresja...", 119 - MENUITEM "&Dekompresja...", 120 - MENUITEM SEPARATOR - MENUITEM "&Uruchom...", ID_EXECUTE - MENUITEM "&Drukuj...", 102 - MENUITEM "Skojarz...", 103 - MENUITEM SEPARATOR - MENUITEM "U&twórz folder...", 111 - MENUITEM "&Szukaj...", 104 - MENUITEM "&Zaznacz pliki...", 116 - MENUITEM SEPARATOR -#ifndef _NO_EXTENSIONS - MENUITEM "&Wyjcie\tAlt+X", ID_FILE_EXIT -#else - MENUITEM "&Wyjcie", ID_FILE_EXIT -#endif - } - - POPUP "&Dysk" { - MENUITEM "&Kopiuj dusk...", 201 - MENUITEM "&Etykieta dysku...", 202 - MENUITEM SEPARATOR - MENUITEM "&Formatuj dysk...", ID_FORMAT_DISK -#ifdef _WIN95 - MENUITEM "&Stwórz dysk systemowy...", -1 /*TODO*/ -#endif - MENUITEM SEPARATOR - MENUITEM "&Pod³¹cz Dysk Sieciowy", ID_CONNECT_NETWORK_DRIVE - MENUITEM "&Od³¹cz Dysk Sieciowy", ID_DISCONNECT_NETWORK_DRIVE - MENUITEM SEPARATOR - MENUITEM "Udostêpnij jako...", 254 - MENUITEM "&Nie udostêpniaj...", 255 - MENUITEM SEPARATOR - MENUITEM "Wybór &dysku...", 251 - } - - POPUP "&Katalogi" { - MENUITEM "&Nastêpny poziom\t+", 301 - MENUITEM "&Rozwiñ drzewo\t*", 302 - MENUITEM "Rozwiñ &wszystko\tStrg+*", 303 - MENUITEM "&Zwiñ drzewo\t-", 304 - MENUITEM SEPARATOR - MENUITEM "Zaznacz &podkatalogi", 505 - } - - POPUP "&Widok" { - MENUITEM "&Drzewo i katalogi", 413 - MENUITEM "D&rzewo", 411 - MENUITEM "&Katalogi", 412 - MENUITEM SEPARATOR - MENUITEM "&Po³¹cz", ID_VIEW_SPLIT - MENUITEM SEPARATOR - MENUITEM "&Nazwa", ID_VIEW_NAME - MENUITEM "&Wszystkie atrybuty pliku", ID_VIEW_ALL_ATTRIBUTES, CHECKED - MENUITEM "Wybrane &atrybuty pliku...", ID_VIEW_SELECTED_ATTRIBUTES - MENUITEM SEPARATOR - MENUITEM "P&osortuj alfabetycznie", 404 - MENUITEM "Posortuj po &typie", 405 - MENUITEM "Rozmieæ &po wielkoci", 406 - MENUITEM "&Sortuj po dacie", 407 - MENUITEM SEPARATOR - MENUITEM "Sortuj po &...", ID_VIEW_FILTER - } - - POPUP "&Opcje" { - MENUITEM "&Potwierdzenie...", 501 - MENUITEM "&Czcionka...", ID_SELECT_FONT - MENUITEM "&Ustawienia paska narzêdzi...", 512 - MENUITEM SEPARATOR - MENUITEM "Pasek &narzêdzi", ID_VIEW_TOOL_BAR, CHECKED - MENUITEM "Pasek &dysków", ID_VIEW_DRIVE_BAR, CHECKED - MENUITEM "Pasek &statusu", ID_VIEW_STATUSBAR, CHECKED -#ifndef _NO_EXTENSIONS - MENUITEM "Pe³ny &ekran\tCtrl+Shift+S", ID_VIEW_FULLSCREEN -#endif - MENUITEM SEPARATOR - MENUITEM "&Zminimalizuj przy starcie", 504 - MENUITEM "Z&apisz ustawienia przed zakoñczeniem",511 - } - - - POPUP "&Bezpieczeñstwo" { - MENUITEM "&Dostêp...", 605 - MENUITEM "&Logowanie...", 606 - MENUITEM "&W³aciciel...", 607 - } - - POPUP "&Okno" { - MENUITEM "&Nowe okno", ID_WINDOW_NEW - MENUITEM "&Kaskaduj¹co\tCtrl+F5", ID_WINDOW_CASCADE - MENUITEM "&Tytu³ pionowo", ID_WINDOW_TILE_HORZ - MENUITEM "Tytu³ &poziomo\tCtrl+F4", ID_WINDOW_TILE_VERT -#ifndef _NO_EXTENSIONS - MENUITEM "Rozmieæ automatycznie", ID_WINDOW_AUTOSORT -#endif - MENUITEM "Rozmieæ &symbole", ID_WINDOW_ARRANGE - MENUITEM "&Odwierz\tF5", ID_REFRESH - } - - POPUP "&?" { - MENUITEM "&Tematu pomocy\tF1", ID_HELP - MENUITEM "&Szukaj...", ID_HELP - MENUITEM "&U¿ywanie pomocy", ID_HELP_USING - MENUITEM SEPARATOR - MENUITEM "&Winefile...", ID_ABOUT -#ifdef __WINE__ - MENUITEM "W&ine...", ID_ABOUT_WINE -#endif - } -} - - -IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Uruchom" -FONT 8, "MS Shell Dlg" -{ - CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 - CONTROL "&Polecenie:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 - EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL - CONTROL "Jako &symbol", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12 - DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 - PUSHBUTTON "Anuluj", 2, 158, 23, 47, 14 - PUSHBUTTON "&Pomoc", 254, 158, 43, 47, 14 -} - -IDD_SELECT_DESTINATION DIALOG FIXED IMPURE 15, 13, 210, 63 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Wybór celu" -FONT 8, "MS Shell Dlg" -{ - CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 - CONTROL "&cie¿ka:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 - EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 - PUSHBUTTON "Anuluj", 2, 158, 23, 47, 14 - PUSHBUTTON "&Przegl¹daj", 254, 158, 43, 47, 14 -} - -STRINGTABLE -{ - IDS_FONT_SEL_DLG_NAME "Wprowadzanie ustawieñ czcionki" - IDS_FONT_SEL_ERROR "B³¹d przy wybieraniu czcionki" -} +/* + * WineFile + * Polish Language Support + * + * Copyright 2000 Martin Fuchs + * Copyright 2002 Steven Edwards + * Copyright 2002 Alexandre Julliard + * Copyright 2004 Piotr Caban + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_POLISH, SUBLANG_DEFAULT + +/* Menu */ + +IDM_WINEFILE MENU FIXED IMPURE +{ + POPUP "&Plik" { + MENUITEM "&Otwórz\tEnter", ID_ACTIVATE + MENUITEM "&Przenie...\tF7", ID_FILE_MOVE + MENUITEM "&Kopiuj...\tF8", ID_FILE_COPY + MENUITEM "W s&chowku...\tF9", 118 + MENUITEM "&Usuñ\tDel", ID_FILE_DELETE + MENUITEM "&Zmieñ nazwê...", 109 + MENUITEM "Ustawie&nia...\tAlt+Enter", ID_EDIT_PROPERTIES + MENUITEM SEPARATOR + MENUITEM "&Kompresja...", 119 + MENUITEM "&Dekompresja...", 120 + MENUITEM SEPARATOR + MENUITEM "&Uruchom...", ID_EXECUTE + MENUITEM "&Drukuj...", 102 + MENUITEM "Skojarz...", 103 + MENUITEM SEPARATOR + MENUITEM "U&twórz folder...", 111 + MENUITEM "&Szukaj...", 104 + MENUITEM "&Zaznacz pliki...", 116 + MENUITEM SEPARATOR +#ifndef _NO_EXTENSIONS + MENUITEM "&Wyjcie\tAlt+X", ID_FILE_EXIT +#else + MENUITEM "&Wyjcie", ID_FILE_EXIT +#endif + } + + POPUP "&Dysk" { + MENUITEM "&Kopiuj dusk...", 201 + MENUITEM "&Etykieta dysku...", 202 + MENUITEM SEPARATOR + MENUITEM "&Formatuj dysk...", ID_FORMAT_DISK +#ifdef _WIN95 + MENUITEM "&Stwórz dysk systemowy...", -1 /*TODO*/ +#endif + MENUITEM SEPARATOR + MENUITEM "&Pod³¹cz Dysk Sieciowy", ID_CONNECT_NETWORK_DRIVE + MENUITEM "&Od³¹cz Dysk Sieciowy", ID_DISCONNECT_NETWORK_DRIVE + MENUITEM SEPARATOR + MENUITEM "Udostêpnij jako...", 254 + MENUITEM "&Nie udostêpniaj...", 255 + MENUITEM SEPARATOR + MENUITEM "Wybór &dysku...", 251 + } + + POPUP "&Katalogi" { + MENUITEM "&Nastêpny poziom\t+", 301 + MENUITEM "&Rozwiñ drzewo\t*", 302 + MENUITEM "Rozwiñ &wszystko\tStrg+*", 303 + MENUITEM "&Zwiñ drzewo\t-", 304 + MENUITEM SEPARATOR + MENUITEM "Zaznacz &podkatalogi", 505 + } + + POPUP "&Widok" { + MENUITEM "&Drzewo i katalogi", 413 + MENUITEM "D&rzewo", 411 + MENUITEM "&Katalogi", 412 + MENUITEM SEPARATOR + MENUITEM "&Po³¹cz", ID_VIEW_SPLIT + MENUITEM SEPARATOR + MENUITEM "&Nazwa", ID_VIEW_NAME + MENUITEM "&Wszystkie atrybuty pliku", ID_VIEW_ALL_ATTRIBUTES, CHECKED + MENUITEM "Wybrane &atrybuty pliku...", ID_VIEW_SELECTED_ATTRIBUTES + MENUITEM SEPARATOR + MENUITEM "P&osortuj alfabetycznie", 404 + MENUITEM "Posortuj po &typie", 405 + MENUITEM "Rozmieæ &po wielkoci", 406 + MENUITEM "&Sortuj po dacie", 407 + MENUITEM SEPARATOR + MENUITEM "Sortuj po &...", ID_VIEW_FILTER + } + + POPUP "&Opcje" { + MENUITEM "&Potwierdzenie...", 501 + MENUITEM "&Czcionka...", ID_SELECT_FONT + MENUITEM "&Ustawienia paska narzêdzi...", 512 + MENUITEM SEPARATOR + MENUITEM "Pasek &narzêdzi", ID_VIEW_TOOL_BAR, CHECKED + MENUITEM "Pasek &dysków", ID_VIEW_DRIVE_BAR, CHECKED + MENUITEM "Pasek &statusu", ID_VIEW_STATUSBAR, CHECKED +#ifndef _NO_EXTENSIONS + MENUITEM "Pe³ny &ekran\tCtrl+Shift+S", ID_VIEW_FULLSCREEN +#endif + MENUITEM SEPARATOR + MENUITEM "&Zminimalizuj przy starcie", 504 + MENUITEM "Z&apisz ustawienia przed zakoñczeniem",511 + } + + + POPUP "&Bezpieczeñstwo" { + MENUITEM "&Dostêp...", 605 + MENUITEM "&Logowanie...", 606 + MENUITEM "&W³aciciel...", 607 + } + + POPUP "&Okno" { + MENUITEM "&Nowe okno", ID_WINDOW_NEW + MENUITEM "&Kaskaduj¹co\tCtrl+F5", ID_WINDOW_CASCADE + MENUITEM "&Tytu³ pionowo", ID_WINDOW_TILE_HORZ + MENUITEM "Tytu³ &poziomo\tCtrl+F4", ID_WINDOW_TILE_VERT +#ifndef _NO_EXTENSIONS + MENUITEM "Rozmieæ automatycznie", ID_WINDOW_AUTOSORT +#endif + MENUITEM "Rozmieæ &symbole", ID_WINDOW_ARRANGE + MENUITEM "&Odwierz\tF5", ID_REFRESH + } + + POPUP "&?" { + MENUITEM "&Tematu pomocy\tF1", ID_HELP + MENUITEM "&Szukaj...", ID_HELP + MENUITEM "&U¿ywanie pomocy", ID_HELP_USING + MENUITEM SEPARATOR + MENUITEM "&Winefile...", ID_ABOUT +#ifdef __WINE__ + MENUITEM "W&ine...", ID_ABOUT_WINE +#endif + } +} + + +IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Uruchom" +FONT 8, "MS Shell Dlg" +{ + CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 + CONTROL "&Polecenie:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 + EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL + CONTROL "Jako &symbol", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12 + DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 + PUSHBUTTON "Anuluj", 2, 158, 23, 47, 14 + PUSHBUTTON "&Pomoc", 254, 158, 43, 47, 14 +} + +IDD_SELECT_DESTINATION DIALOG FIXED IMPURE 15, 13, 210, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Wybór celu" +FONT 8, "MS Shell Dlg" +{ + CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 + CONTROL "&cie¿ka:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 + EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL + DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 + PUSHBUTTON "Anuluj", 2, 158, 23, 47, 14 + PUSHBUTTON "&Przegl¹daj", 254, 158, 43, 47, 14 +} + +STRINGTABLE +{ + IDS_FONT_SEL_DLG_NAME "Wprowadzanie ustawieñ czcionki" + IDS_FONT_SEL_ERROR "B³¹d przy wybieraniu czcionki" +} Propchange: trunk/reactos/base/applications/winefile/lang/Pl.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/winefile/lang/Sv.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
============================================================================== --- trunk/reactos/base/applications/winefile/lang/Sv.rc (original) +++ trunk/reactos/base/applications/winefile/lang/Sv.rc Wed Oct 4 14:59:01 2006 @@ -1,209 +1,209 @@ -/* - * WineFile - * Swedish Language Support - * - * Copyright 2005 David Nordenberg - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL -#pragma code_page(1252) - - -/* Menu */ - - -IDM_WINEFILE MENU FIXED IMPURE -{ - POPUP "&Arkiv" { - MENUITEM "&Öppna\tEnter", ID_ACTIVATE - MENUITEM "&Flytta...\tF7", ID_FILE_MOVE - MENUITEM "&Kopiera...\tF8", ID_FILE_COPY - MENUITEM "&I urklipp...\tF9", 118 - MENUITEM "&Ta bort\tDel", ID_FILE_DELETE - MENUITEM "&Byt namn...", 109 - MENUITEM "&Egenskaper...\tAlt+Enter", ID_EDIT_PROPERTIES - MENUITEM SEPARATOR - MENUITEM "&Komprimera...", 119 - MENUITEM "Packa &upp...", 120 - MENUITEM SEPARATOR - MENUITEM "&Kör...", ID_EXECUTE - MENUITEM "&Skriv ut...", 102 - MENUITEM "Associera...", 103 - MENUITEM SEPARATOR - MENUITEM "Skapa mapp...", 111 - MENUITEM "&Sök...", 104 - MENUITEM "&Välj filer...", 116 - MENUITEM SEPARATOR -#ifndef _NO_EXTENSIONS - MENUITEM "&Avsluta\tAlt+X", ID_FILE_EXIT -#else - MENUITEM "&Avsluta", ID_FILE_EXIT -#endif - } - - POPUP "&Disk" { - MENUITEM "&Kopiera disk...", 201 - MENUITEM "&Namnge disk...", 202 - MENUITEM SEPARATOR - MENUITEM "&Formatera disk...", ID_FORMAT_DISK -#ifdef _WIN95 - MENUITEM "&Skapa systemdisk...", -1 /*TODO*/ -#endif - MENUITEM SEPARATOR - MENUITEM "Anslut &Nätverksenhet", ID_CONNECT_NETWORK_DRIVE - MENUITEM "&Koppla ifrån Nätverksenhet", ID_DISCONNECT_NETWORK_DRIVE - MENUITEM SEPARATOR - MENUITEM "Dela ut...", 254 - MENUITEM "&Ta bort utdelning...", 255 - MENUITEM SEPARATOR - MENUITEM "&Välj enhet...", 251 - } - - POPUP "&Träd" { - MENUITEM "&Nästa nivå\t+", 301 - MENUITEM "Utöka &träd\t*", 302 - MENUITEM "Utöka &alla\tCtrl+*", 303 - MENUITEM "Kollapsa &träd\t-", 304 - MENUITEM SEPARATOR - MENUITEM "&Markera undermappar", 505 - } - - POPUP "&Visa" { - MENUITEM "&Träd och mapp", 413 - MENUITEM "Bara tr&äd", 411 - MENUITEM "Bara &mapp", 412 - MENUITEM SEPARATOR - MENUITEM "De&la", ID_VIEW_SPLIT - MENUITEM SEPARATOR - MENUITEM "&Namn", ID_VIEW_NAME - MENUITEM "&Alla Fildetaljer", ID_VIEW_ALL_ATTRIBUTES, CHECKED - MENUITEM "&Vissa detaljer...", ID_VIEW_SELECTED_ATTRIBUTES - MENUITEM SEPARATOR - MENUITEM "&Sortera efter namn", ID_VIEW_SORT_NAME - MENUITEM "Sortera efter t&yp", ID_VIEW_SORT_TYPE - MENUITEM "Sortera efter st&orlek", ID_VIEW_SORT_SIZE - MENUITEM "Sortera efter &datum", ID_VIEW_SORT_DATE - MENUITEM SEPARATOR - MENUITEM "Sortera efter &...", ID_VIEW_FILTER - } - - POPUP "&Inställningar" { - MENUITEM "&Bekräftelse...", 501 - MENUITEM "&Teckensnitt...", ID_SELECT_FONT - MENUITEM "&Konfigurera verktygsfält...", 512 - MENUITEM SEPARATOR - MENUITEM "&Verktygsfält", ID_VIEW_TOOL_BAR, CHECKED - MENUITEM "&Enhetsfält", ID_VIEW_DRIVE_BAR, CHECKED - MENUITEM "St&atusfält", ID_VIEW_STATUSBAR, CHECKED -#ifndef _NO_EXTENSIONS - MENUITEM "F&ullskärm\tCtrl+Shift+S", ID_VIEW_FULLSCREEN -#endif - MENUITEM SEPARATOR - MENUITEM "&Minimera vid körning", 504 - MENUITEM "&Spara ändringar vid stängning", 511 - } - - POPUP "&Säkerhet" { - MENUITEM "&Åtkomst...", 605 - MENUITEM "&Loggning...", 606 - MENUITEM "&Ägare...", 607 - } - - POPUP "&Fönster" { - MENUITEM "Nytt &fönster", ID_WINDOW_NEW - MENUITEM "Överlappande\tCtrl+F5", ID_WINDOW_CASCADE - MENUITEM "Ordna &horizontellt", ID_WINDOW_TILE_HORZ - MENUITEM "Ordna &vertikalt\tCtrl+F4", ID_WINDOW_TILE_VERT -#ifndef _NO_EXTENSIONS - MENUITEM "Ordna automatiskt", ID_WINDOW_AUTOSORT -#endif - MENUITEM "Ordna &symboler", ID_WINDOW_ARRANGE - MENUITEM "&Uppdatera\tF5", ID_REFRESH - } - - POPUP "&?" { - MENUITEM "&Hjälpavsnitt\tF1", ID_HELP - MENUITEM "Hjälp &sök...\tF1", ID_HELP - MENUITEM "&Använda hjälpen\tF1", ID_HELP_USING - MENUITEM SEPARATOR - MENUITEM "Information om &Winefile...", ID_ABOUT -#ifdef __WINE__ - MENUITEM "Info about &Wine...", ID_ABOUT_WINE -#endif - } -} - - -IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Kör" -FONT 8, "MS Shell Dlg" -{ - CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 - CONTROL "&Kommando:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 - EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL - CONTROL "Som &symbol", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12 - DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 - PUSHBUTTON "Avbryt", 2, 158, 23, 47, 14 - PUSHBUTTON "&Hjälp", 254, 158, 43, 47, 14 -} - -IDD_SELECT_DESTINATION DIALOG FIXED IMPURE 15, 13, 210, 63 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Välj mål" -FONT 8, "MS Shell Dlg" -{ - CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 - CONTROL "&Sökväg:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 - EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 - PUSHBUTTON "Avbryt", 2, 158, 23, 47, 14 - PUSHBUTTON "&Bläddra", 254, 158, 43, 47, 14 -} - -STRINGTABLE -{ - IDS_FONT_SEL_DLG_NAME "Verkställ teckensnittsinställningar" - IDS_FONT_SEL_ERROR "Ett fel uppstog när ett nytt teckensnitt valdes." -} - -STRINGTABLE -{ - IDS_WINEFILE "Winefile" - IDS_ERROR "Fel" - IDS_ROOT_FS "root fs" - IDS_UNIXFS "unixfs" - IDS_DESKTOP "Skrivbord" - IDS_SHELL "Skal" - IDS_TITLEFMT "%s - %s" - IDS_NO_IMPL "Ej implementerat ännu" - IDS_WINE "WINE" - IDS_WINE_FILE "Wine File" -} - -STRINGTABLE -{ - IDS_COL_NAME "Namn" - IDS_COL_SIZE "Storlek" - IDS_COL_CDATE "CDatum" - IDS_COL_ADATE "ADatum" - IDS_COL_MDATE "MDatum" - IDS_COL_IDX "Index/Inode" - IDS_COL_LINKS "Länkar" - IDS_COL_ATTR "Attribut" - IDS_COL_SEC "Säkerhet" -} +/* + * WineFile + * Swedish Language Support + * + * Copyright 2005 David Nordenberg + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL +#pragma code_page(1252) + + +/* Menu */ + + +IDM_WINEFILE MENU FIXED IMPURE +{ + POPUP "&Arkiv" { + MENUITEM "&Öppna\tEnter", ID_ACTIVATE + MENUITEM "&Flytta...\tF7", ID_FILE_MOVE + MENUITEM "&Kopiera...\tF8", ID_FILE_COPY + MENUITEM "&I urklipp...\tF9", 118 + MENUITEM "&Ta bort\tDel", ID_FILE_DELETE + MENUITEM "&Byt namn...", 109 + MENUITEM "&Egenskaper...\tAlt+Enter", ID_EDIT_PROPERTIES + MENUITEM SEPARATOR + MENUITEM "&Komprimera...", 119 + MENUITEM "Packa &upp...", 120 + MENUITEM SEPARATOR + MENUITEM "&Kör...", ID_EXECUTE + MENUITEM "&Skriv ut...", 102 + MENUITEM "Associera...", 103 + MENUITEM SEPARATOR + MENUITEM "Skapa mapp...", 111 + MENUITEM "&Sök...", 104 + MENUITEM "&Välj filer...", 116 + MENUITEM SEPARATOR +#ifndef _NO_EXTENSIONS + MENUITEM "&Avsluta\tAlt+X", ID_FILE_EXIT +#else + MENUITEM "&Avsluta", ID_FILE_EXIT +#endif + } + + POPUP "&Disk" { + MENUITEM "&Kopiera disk...", 201 + MENUITEM "&Namnge disk...", 202 + MENUITEM SEPARATOR + MENUITEM "&Formatera disk...", ID_FORMAT_DISK +#ifdef _WIN95 + MENUITEM "&Skapa systemdisk...", -1 /*TODO*/ +#endif + MENUITEM SEPARATOR + MENUITEM "Anslut &Nätverksenhet", ID_CONNECT_NETWORK_DRIVE + MENUITEM "&Koppla ifrån Nätverksenhet", ID_DISCONNECT_NETWORK_DRIVE + MENUITEM SEPARATOR + MENUITEM "Dela ut...", 254 + MENUITEM "&Ta bort utdelning...", 255 + MENUITEM SEPARATOR + MENUITEM "&Välj enhet...", 251 + } + + POPUP "&Träd" { + MENUITEM "&Nästa nivå\t+", 301 + MENUITEM "Utöka &träd\t*", 302 + MENUITEM "Utöka &alla\tCtrl+*", 303 + MENUITEM "Kollapsa &träd\t-", 304 + MENUITEM SEPARATOR + MENUITEM "&Markera undermappar", 505 + } + + POPUP "&Visa" { + MENUITEM "&Träd och mapp", 413 + MENUITEM "Bara tr&äd", 411 + MENUITEM "Bara &mapp", 412 + MENUITEM SEPARATOR + MENUITEM "De&la", ID_VIEW_SPLIT + MENUITEM SEPARATOR + MENUITEM "&Namn", ID_VIEW_NAME + MENUITEM "&Alla Fildetaljer", ID_VIEW_ALL_ATTRIBUTES, CHECKED + MENUITEM "&Vissa detaljer...", ID_VIEW_SELECTED_ATTRIBUTES + MENUITEM SEPARATOR + MENUITEM "&Sortera efter namn", ID_VIEW_SORT_NAME + MENUITEM "Sortera efter t&yp", ID_VIEW_SORT_TYPE + MENUITEM "Sortera efter st&orlek", ID_VIEW_SORT_SIZE + MENUITEM "Sortera efter &datum", ID_VIEW_SORT_DATE + MENUITEM SEPARATOR + MENUITEM "Sortera efter &...", ID_VIEW_FILTER + } + + POPUP "&Inställningar" { + MENUITEM "&Bekräftelse...", 501 + MENUITEM "&Teckensnitt...", ID_SELECT_FONT + MENUITEM "&Konfigurera verktygsfält...", 512 + MENUITEM SEPARATOR + MENUITEM "&Verktygsfält", ID_VIEW_TOOL_BAR, CHECKED + MENUITEM "&Enhetsfält", ID_VIEW_DRIVE_BAR, CHECKED + MENUITEM "St&atusfält", ID_VIEW_STATUSBAR, CHECKED +#ifndef _NO_EXTENSIONS + MENUITEM "F&ullskärm\tCtrl+Shift+S", ID_VIEW_FULLSCREEN +#endif + MENUITEM SEPARATOR + MENUITEM "&Minimera vid körning", 504 + MENUITEM "&Spara ändringar vid stängning", 511 + } + + POPUP "&Säkerhet" { + MENUITEM "&Åtkomst...", 605 + MENUITEM "&Loggning...", 606 + MENUITEM "&Ägare...", 607 + } + + POPUP "&Fönster" { + MENUITEM "Nytt &fönster", ID_WINDOW_NEW + MENUITEM "Överlappande\tCtrl+F5", ID_WINDOW_CASCADE + MENUITEM "Ordna &horizontellt", ID_WINDOW_TILE_HORZ + MENUITEM "Ordna &vertikalt\tCtrl+F4", ID_WINDOW_TILE_VERT +#ifndef _NO_EXTENSIONS + MENUITEM "Ordna automatiskt", ID_WINDOW_AUTOSORT +#endif + MENUITEM "Ordna &symboler", ID_WINDOW_ARRANGE + MENUITEM "&Uppdatera\tF5", ID_REFRESH + } + + POPUP "&?" { + MENUITEM "&Hjälpavsnitt\tF1", ID_HELP + MENUITEM "Hjälp &sök...\tF1", ID_HELP + MENUITEM "&Använda hjälpen\tF1", ID_HELP_USING + MENUITEM SEPARATOR + MENUITEM "Information om &Winefile...", ID_ABOUT +#ifdef __WINE__ + MENUITEM "Info about &Wine...", ID_ABOUT_WINE +#endif + } +} + + +IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Kör" +FONT 8, "MS Shell Dlg" +{ + CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 + CONTROL "&Kommando:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 + EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL + CONTROL "Som &symbol", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12 + DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 + PUSHBUTTON "Avbryt", 2, 158, 23, 47, 14 + PUSHBUTTON "&Hjälp", 254, 158, 43, 47, 14 +} + +IDD_SELECT_DESTINATION DIALOG FIXED IMPURE 15, 13, 210, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Välj mål" +FONT 8, "MS Shell Dlg" +{ + CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 + CONTROL "&Sökväg:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 + EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL + DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 + PUSHBUTTON "Avbryt", 2, 158, 23, 47, 14 + PUSHBUTTON "&Bläddra", 254, 158, 43, 47, 14 +} + +STRINGTABLE +{ + IDS_FONT_SEL_DLG_NAME "Verkställ teckensnittsinställningar" + IDS_FONT_SEL_ERROR "Ett fel uppstog när ett nytt teckensnitt valdes." +} + +STRINGTABLE +{ + IDS_WINEFILE "Winefile" + IDS_ERROR "Fel" + IDS_ROOT_FS "root fs" + IDS_UNIXFS "unixfs" + IDS_DESKTOP "Skrivbord" + IDS_SHELL "Skal" + IDS_TITLEFMT "%s - %s" + IDS_NO_IMPL "Ej implementerat ännu" + IDS_WINE "WINE" + IDS_WINE_FILE "Wine File" +} + +STRINGTABLE +{ + IDS_COL_NAME "Namn" + IDS_COL_SIZE "Storlek" + IDS_COL_CDATE "CDatum" + IDS_COL_ADATE "ADatum" + IDS_COL_MDATE "MDatum" + IDS_COL_IDX "Index/Inode" + IDS_COL_LINKS "Länkar" + IDS_COL_ATTR "Attribut" + IDS_COL_SEC "Säkerhet" +} Propchange: trunk/reactos/base/applications/winefile/lang/Sv.rc ------------------------------------------------------------------------------ svn:eol-style = native
18 years, 2 months
1
0
0
0
[arty] 24390: - Create a slab that contains the last vestage of our life as the boot program. - Include a font containing some characters we can use with boot video. - Copy in a description of the boot framebuffer. - Add a small ad-hoc number writing function. - Display our progress building the initial page table. - We don't necessarily have space in the boot-time page table so just kill off boot-time paging. - Pass ntoskrnl the address of the boot slab. It contains the boot font, a description
by arty@svn.reactos.org
Author: arty Date: Wed Oct 4 12:10:01 2006 New Revision: 24390 URL:
http://svn.reactos.org/svn/reactos?rev=24390&view=rev
Log: - Create a slab that contains the last vestage of our life as the boot program. - Include a font containing some characters we can use with boot video. - Copy in a description of the boot framebuffer. - Add a small ad-hoc number writing function. - Display our progress building the initial page table. - We don't necessarily have space in the boot-time page table so just kill off boot-time paging. - Pass ntoskrnl the address of the boot slab. It contains the boot font, a description of the boot video device and all active page table entries. - Next, well be able to use this in early ntoskrnl space to display our progress etc. Since we're using phyiscal addresses to write to the boot framebuffer, the page table needn't include it. This simplifies things compared to linux, but it's expensive. Modified: branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/compat.h branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mmu.c branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mmu.h branches/powerpc/reactos/include/reactos/ppcboot.h Modified: branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/fr…
============================================================================== --- branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s (original) +++ branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s Wed Oct 4 12:10:01 2006 @@ -1,3 +1,8 @@ .extern PpcInit _start: b PpcInit + + .globl _bss + .section ".bss" +_bss: + .long 0 Modified: branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/compat.h URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/fr…
============================================================================== --- branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/compat.h (original) +++ branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/compat.h Wed Oct 4 12:10:01 2006 @@ -103,6 +103,107 @@ void *ioremap(__u32 phys, __u32 size); void iounmap(void *logical); +font_char BootDigits[16] = { + " XXXXX " + "X X " + "X x X " + "X X X " + "X X " + " XXXXX " + " ", + " XX " + " XXX " + " XX " + " XX " + " XX " + " XX " + " ", + " XXXX " + " X X " + " XX " + " XX " + " XX " + " XXXXXX " + " ", + " XXXX " + " X X " + " XX " + " X " + " X X " + " XXXX " + " ", + " X X " + " X X " + " XXXXXX " + " X " + " X " + " X " + " ", + " XXXXXX " + " X " + " XXXXX " + " X " + " X " + " XXXXX " + " ", + " XXXXX " + " X " + " XXXXX " + " X X " + " X X " + " XXXX " + " ", + " XXXXXX " + " XX " + " XX " + " XXXXX " + " XX " + " XX " + " ", + " XXXX " + " X X " + " XXXX " + " X X " + " X X " + " XXXX " + " ", + " XXXX " + " X X " + " XXXXXX " + " X X " + " X X " + " X X " + " ", + " XXXXX " + " X X " + " XXXXX " + " X X " + " X X " + " XXXXX " + " ", + " XXXX " + " X X " + " X " + " X " + " X X " + " XXXX " + " ", + " XXXXXX " + " X " + " XXXX " + " X " + " X " + " XXXXXX " + " ", + " XXXXXX " + " X " + " XXXX " + " X " + " X " + " X " + " " +}; + __u32 GetPVR(); #endif/*_FREELDR_ARCH_COMPAT_H*/ Modified: branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/fr…
============================================================================== --- branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c (original) +++ branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c Wed Oct 4 12:10:01 2006 @@ -28,7 +28,7 @@ extern ULONG CacheSizeLimit; of_proxy ofproxy; void *PageDirectoryStart, *PageDirectoryEnd; -static int chosen_package, stdin_handle, part_handle = -1; +static int chosen_package, stdin_handle, part_handle = -1, kernel_mem = 0; BOOLEAN AcpiPresent = FALSE; char BootPath[0x100] = { 0 }, BootPart[0x100] = { 0 }, CmdLine[0x100] = { 0 }; jmp_buf jmp; @@ -340,10 +340,20 @@ (int)BiosMemoryMap[slots].BaseAddress, (int)BiosMemoryMap[slots].Length); - if( BiosMemoryMap[slots].Length && + /* Hack for pearpc */ + if( kernel_mem ) { + BiosMemoryMap[slots].Length = kernel_mem * 1024; ofw_claim((int)BiosMemoryMap[slots].BaseAddress, (int)BiosMemoryMap[slots].Length, - 0x1000) ) { + 0x1000); + total += BiosMemoryMap[slots].Length; + slots++; + break; + /* Normal way */ + } else if( BiosMemoryMap[slots].Length && + ofw_claim((int)BiosMemoryMap[slots].BaseAddress, + (int)BiosMemoryMap[slots].Length, + 0x1000) ) { total += BiosMemoryMap[slots].Length; slots++; } @@ -555,10 +565,10 @@ len = ofw_getprop(chosen_package, "bootargs", CmdLine, sizeof(CmdLine)); - printf("bootargs: len %d\n", len); - if( len < 0 ) len = 0; CmdLine[len] = 0; + + printf("bootargs: len %d [%s]\n", len, CmdLine); BootMain( CmdLine ); } @@ -572,15 +582,19 @@ printf( "Determining boot device: [%s]\n", CmdLine ); - printf( "Boot Args: %s\n", CmdLine ); sep = NULL; for( i = 0; i < strlen(CmdLine); i++ ) { if( strncmp(CmdLine + i, "boot=", 5) == 0) { strcpy(BootPart, CmdLine + i + 5); - sep = strchr(BootPart, ' '); + sep = strchr(BootPart, ','); if( sep ) *sep = 0; - break; + while(CmdLine[i] && CmdLine[i]!=',') i++; + } + if( strncmp(CmdLine + i, "mem=", 4) == 0) { + kernel_mem = atoi(CmdLine+i+4); + printf("Allocate %dk kernel memory\n", kernel_mem); + while(CmdLine[i] && CmdLine[i]!=',') i++; } } Modified: branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/fr…
============================================================================== --- branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c (original) +++ branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c Wed Oct 4 12:10:01 2006 @@ -20,12 +20,15 @@ #include <freeldr.h> #include <of_call.h> +#include "ppcboot.h" #include "mmu.h" +#include "compat.h" #define NDEBUG #include <debug.h> static PVOID KernelMemory = 0; +extern boot_infos_t BootInfo; /* Bits to shift to convert a Virtual Address into an Offset in the Page Table */ #define PFN_SHIFT 12 @@ -108,25 +111,96 @@ typedef void (*KernelEntryFn)( void * ); VOID +DrawDigit(boot_infos_t *BootInfo, ULONG Digit, int x, int y) +{ + int i,j,k; + + for( i = 0; i < 7; i++ ) { + for( j = 0; j < 8; j++ ) { + for( k = 0; k < BootInfo->dispDeviceDepth/8; k++ ) { + SetPhysByte(((ULONG_PTR)BootInfo->dispDeviceBase)+ + k + + (((j+x) * (BootInfo->dispDeviceDepth/8)) + + ((i+y) * (BootInfo->dispDeviceRowBytes))), + BootInfo->dispFont[Digit][i*8+j] == ' ' ? 0 : 255); + } + } + } +} + +VOID +DrawNumber(boot_infos_t *BootInfo, ULONG Number, int x, int y) +{ + int i; + + for( i = 0; i < 8; i++, Number<<=4 ) { + DrawDigit(BootInfo,(Number>>28)&0xf,x+(i*8),y); + } +} + +VOID NTAPI FrLdrStartup(ULONG Magic) { KernelEntryFn KernelEntryAddress = (KernelEntryFn)(KernelEntry + KernelBase); - ULONG_PTR PhysAddr, i; - - for( i = 0; i < KernelMemorySize; i+=1<<PFN_SHIFT ) + register ULONG_PTR i asm("r4"), j asm("r5"); + UINT NeededPTE = ((UINT)KernelMemory) >> PFN_SHIFT; + UINT NeededMemory = + (2 * sizeof(ULONG_PTR) * (NeededPTE + NeededPTE / 512)) + + sizeof(BootInfo) + sizeof(BootDigits); + UINT NeededPages = ROUND_UP(NeededMemory,(1<<PFN_SHIFT)); + register PULONG_PTR TranslationMap asm("r6") = + MmAllocateMemory(NeededMemory); + boot_infos_t *LocalBootInfo = (boot_infos_t *)TranslationMap; + TranslationMap = (PULONG_PTR) + (((PCHAR)&LocalBootInfo[1]) + sizeof(BootDigits)); + memcpy(&LocalBootInfo[1], BootDigits, sizeof(BootDigits)); + *LocalBootInfo = BootInfo; + LocalBootInfo->dispFont = (font_char *)&LocalBootInfo[1]; + + TranslationMap[0] = (ULONG_PTR)FrLdrStartup; + for( i = 1; i < NeededPages; i++ ) { - PhysAddr = PpcVirt2phys((ULONG)KernelMemory + i,0); - - if( !InsertPageEntry(KernelBase + i,PhysAddr) ) - { - printf("Foo: couldn't find a page slot for %x\n", i); - while(1); - } - } - - KernelEntryAddress( (void*)Magic ); + TranslationMap[i*2] = NeededMemory+(i<<PFN_SHIFT); + } + + for( j = 0; j < KernelMemorySize>>PFN_SHIFT; j++ ) + { + TranslationMap[(i+j)*2] = ((UINT)(KernelMemory+(i<<PFN_SHIFT))); + } + + for( i = 0; i < j; i++ ) + { + TranslationMap[(i*2)+1] = PpcVirt2phys(TranslationMap[i*2],0); + } + + printf("Built map of %d pages\n", j); + + /* + * Stuff page table entries for the page containing this code, + * The pages containing the page table entries, and finally the kernel + * pages. + * + * When done, we'll be able to flop over to kernel land! + */ + for( i = 0; i < j; i++ ) + { + DrawNumber(LocalBootInfo,i,10,90); + DrawNumber(LocalBootInfo,TranslationMap[i*2],10,100); + DrawNumber(LocalBootInfo,TranslationMap[i*2+1],10,110); + + InsertPageEntry + (TranslationMap[i*2], + TranslationMap[(i*2)+1], + (i>>10)); + } + + /* Tell them we're booting */ + DrawNumber(LocalBootInfo,0x1cabba9e,10,120); + DrawNumber(LocalBootInfo,(ULONG)KernelEntryAddress,100,120); + + KernelEntryAddress( (void*)LocalBootInfo ); while(1); } Modified: branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mmu.c URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/fr…
============================================================================== --- branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mmu.c (original) +++ branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mmu.c Wed Oct 4 12:10:01 2006 @@ -293,7 +293,7 @@ } /* Add a new page table entry for the indicated mapping */ -BOOLEAN InsertPageEntry( int virt, int phys ) { +BOOLEAN InsertPageEntry( int virt, int phys, int slot ) { int i, ptehi, ptelo; int sdr1 = GetSDR1(); int sr = GetSR( (virt >> 28) & 0xf ); @@ -307,7 +307,7 @@ for( i = 0; i < 8; i++ ) { ptehi = GetPhys( ptegaddr + (i * 8) ); - if( ptehi & 0x80000000 ) continue; + if( (slot != i) && (ptehi & 0x80000000) ) continue; ptehi = (1 << 31) | (vsid << 7) | ((virt >> 22) & 0x3f); ptelo = phys & ~0xfff; Modified: branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mmu.h URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/fr…
============================================================================== --- branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mmu.h (original) +++ branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mmu.h Wed Oct 4 12:10:01 2006 @@ -14,6 +14,6 @@ int BatTranslate( int bath, int batl, int virt ); /* translate address */ int PpcVirt2phys( int virt, int inst ); -BOOLEAN InsertPageEntry( int virt, int phys ); +BOOLEAN InsertPageEntry( int virt, int phys, int slot ); #endif/*FREELDR_MMU_H*/ Modified: branches/powerpc/reactos/include/reactos/ppcboot.h URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/include/reactos…
============================================================================== --- branches/powerpc/reactos/include/reactos/ppcboot.h (original) +++ branches/powerpc/reactos/include/reactos/ppcboot.h Wed Oct 4 12:10:01 2006 @@ -1,11 +1,13 @@ #ifndef REACTOS_PPCBOOT_H #define REACTOS_PPCBOOT_H +typedef char font_char[57]; typedef struct _boot_infos_t { int dispDeviceRect[4]; int dispDeviceRowBytes; int dispDeviceDepth; void *dispDeviceBase; + font_char *dispFont; } boot_infos_t; #endif/*REACTOS_PPCBOOT_H*/
18 years, 2 months
1
0
0
0
[greatlrd] 24389: 1. move all languages file to own folder 2. fixed sub languages on allot languages rc files 3. add LMH1 Norwegian translations. See issue #1698 for more details.
by greatlrd@svn.reactos.org
Author: greatlrd Date: Wed Oct 4 10:58:03 2006 New Revision: 24389 URL:
http://svn.reactos.org/svn/reactos?rev=24389&view=rev
Log: 1. move all languages file to own folder 2. fixed sub languages on allot languages rc files 3. add LMH1 Norwegian translations. See issue #1698 for more details. Added: trunk/reactos/base/applications/winefile/lang/ trunk/reactos/base/applications/winefile/lang/Cs.rc - copied, changed from r24388, trunk/reactos/base/applications/winefile/cs.rc trunk/reactos/base/applications/winefile/lang/De.rc - copied unchanged from r24388, trunk/reactos/base/applications/winefile/de.rc trunk/reactos/base/applications/winefile/lang/En.rc - copied unchanged from r24388, trunk/reactos/base/applications/winefile/en.rc trunk/reactos/base/applications/winefile/lang/Es.rc - copied unchanged from r24388, trunk/reactos/base/applications/winefile/es.rc trunk/reactos/base/applications/winefile/lang/Fr.rc - copied unchanged from r24388, trunk/reactos/base/applications/winefile/fr.rc trunk/reactos/base/applications/winefile/lang/Hu.rc - copied, changed from r24388, trunk/reactos/base/applications/winefile/hu.rc trunk/reactos/base/applications/winefile/lang/It.rc - copied unchanged from r24388, trunk/reactos/base/applications/winefile/it.rc trunk/reactos/base/applications/winefile/lang/Nl.rc - copied unchanged from r24388, trunk/reactos/base/applications/winefile/nl.rc trunk/reactos/base/applications/winefile/lang/No.rc (with props) trunk/reactos/base/applications/winefile/lang/Pl.rc - copied, changed from r24388, trunk/reactos/base/applications/winefile/pl.rc trunk/reactos/base/applications/winefile/lang/Pt.rc - copied unchanged from r24388, trunk/reactos/base/applications/winefile/pt.rc trunk/reactos/base/applications/winefile/lang/Ru.rc - copied, changed from r24388, trunk/reactos/base/applications/winefile/ru.rc trunk/reactos/base/applications/winefile/lang/Si.rc - copied, changed from r24388, trunk/reactos/base/applications/winefile/si.rc trunk/reactos/base/applications/winefile/lang/Sv.rc - copied unchanged from r24388, trunk/reactos/base/applications/winefile/Sv.rc trunk/reactos/base/applications/winefile/lang/Zh.rc - copied unchanged from r24388, trunk/reactos/base/applications/winefile/zh.rc Removed: trunk/reactos/base/applications/winefile/Sv.rc trunk/reactos/base/applications/winefile/cs.rc trunk/reactos/base/applications/winefile/de.rc trunk/reactos/base/applications/winefile/en.rc trunk/reactos/base/applications/winefile/es.rc trunk/reactos/base/applications/winefile/fr.rc trunk/reactos/base/applications/winefile/hu.rc trunk/reactos/base/applications/winefile/it.rc trunk/reactos/base/applications/winefile/nl.rc trunk/reactos/base/applications/winefile/pl.rc trunk/reactos/base/applications/winefile/pt.rc trunk/reactos/base/applications/winefile/ru.rc trunk/reactos/base/applications/winefile/si.rc trunk/reactos/base/applications/winefile/zh.rc Modified: trunk/reactos/base/applications/winefile/winefile.rc [This mail would be too long, it was shortened to contain the URLs only.] Removed: trunk/reactos/base/applications/winefile/Sv.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Removed: trunk/reactos/base/applications/winefile/cs.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Removed: trunk/reactos/base/applications/winefile/de.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Removed: trunk/reactos/base/applications/winefile/en.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Removed: trunk/reactos/base/applications/winefile/es.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Removed: trunk/reactos/base/applications/winefile/fr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Removed: trunk/reactos/base/applications/winefile/hu.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Removed: trunk/reactos/base/applications/winefile/it.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Copied: trunk/reactos/base/applications/winefile/lang/Cs.rc (from r24388, trunk/reactos/base/applications/winefile/cs.rc) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Copied: trunk/reactos/base/applications/winefile/lang/Hu.rc (from r24388, trunk/reactos/base/applications/winefile/hu.rc) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Added: trunk/reactos/base/applications/winefile/lang/No.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Copied: trunk/reactos/base/applications/winefile/lang/Pl.rc (from r24388, trunk/reactos/base/applications/winefile/pl.rc) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Copied: trunk/reactos/base/applications/winefile/lang/Ru.rc (from r24388, trunk/reactos/base/applications/winefile/ru.rc) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Copied: trunk/reactos/base/applications/winefile/lang/Si.rc (from r24388, trunk/reactos/base/applications/winefile/si.rc) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Removed: trunk/reactos/base/applications/winefile/nl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Removed: trunk/reactos/base/applications/winefile/pl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Removed: trunk/reactos/base/applications/winefile/pt.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Removed: trunk/reactos/base/applications/winefile/ru.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Removed: trunk/reactos/base/applications/winefile/si.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Modified: trunk/reactos/base/applications/winefile/winefile.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
Removed: trunk/reactos/base/applications/winefile/zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winefile…
18 years, 2 months
1
0
0
0
[ion] 24388: - Fix boot crash due to last patch, forgot that SharedUserDAta wasn't available yet.
by ion@svn.reactos.org
Author: ion Date: Wed Oct 4 09:59:56 2006 New Revision: 24388 URL:
http://svn.reactos.org/svn/reactos?rev=24388&view=rev
Log: - Fix boot crash due to last patch, forgot that SharedUserDAta wasn't available yet. Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/kiinit.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c Wed Oct 4 09:59:56 2006 @@ -297,6 +297,7 @@ ULONG FeatureBits; LARGE_INTEGER PageDirectory; PVOID DpcStack; + ULONG NXSupportPolicy; /* Detect and set the CPU Type */ KiSetProcessorType(); @@ -316,38 +317,38 @@ /* Get the processor features for the CPU */ FeatureBits = KiGetFeatureBits(); + /* Set the default NX policy (opt-in) */ + NXSupportPolicy = 2; + + /* Check if NPX is always on */ + if (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=ALWAYSON")) + { + /* Set it always on */ + NXSupportPolicy = 1; + FeatureBits |= KF_NX_ENABLED; + } + else if (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=OPTOUT")) + { + /* Set it in opt-out mode */ + NXSupportPolicy = 3; + FeatureBits |= KF_NX_ENABLED; + } + else if ((strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=OPTIN")) || + (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE"))) + { + /* Set the feature bits */ + FeatureBits |= KF_NX_ENABLED; + } + else if ((strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=ALWAYSOFF")) || + (strstr(KeLoaderBlock->LoadOptions, "EXECUTE"))) + { + /* Set disabled mode */ + NXSupportPolicy = 0; + FeatureBits |= KF_NX_DISABLED; + } + /* Save feature bits */ Prcb->FeatureBits = FeatureBits; - - /* Set the default NX policy (opt-in) */ - SharedUserData->NXSupportPolicy = 2; - - /* Check if NPX is always on */ - if (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=ALWAYSON")) - { - /* Set it always on */ - SharedUserData->NXSupportPolicy = 1; - KeFeatureBits |= KF_NX_ENABLED; - } - else if (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=OPTOUT")) - { - /* Set it in opt-out mode */ - SharedUserData->NXSupportPolicy = 3; - KeFeatureBits |= KF_NX_ENABLED; - } - else if ((strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=OPTIN")) || - (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE"))) - { - /* Set the feature bits */ - KeFeatureBits |= KF_NX_ENABLED; - } - else if ((strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=ALWAYSOFF")) || - (strstr(KeLoaderBlock->LoadOptions, "EXECUTE"))) - { - /* Set disabled mode */ - SharedUserData->NXSupportPolicy = 0; - KeFeatureBits |= KF_NX_DISABLED; - } /* Save CPU state */ KiSaveProcessorControlState(&Prcb->ProcessorState); @@ -416,6 +417,9 @@ /* Sets up the Text Sections of the Kernel and HAL for debugging */ LdrInit1(); + + /* Set the NX Support policy */ + SharedUserData->NXSupportPolicy = NXSupportPolicy; /* Setup the Idle Thread */ KeInitializeThread(InitProcess,
18 years, 2 months
1
0
0
0
[ion] 24387: - Fix KUSER_SHARED_DATA in winddk.h - Scanfor NOEXECUTE/EXECUTE/OPTIN/OPTOUT/ALWAYSON/ALWAYSOFF load strings and set the appropriate NX policy in KUSER_SHARED_DATA as well as kernel CPU Feature flags.
by ion@svn.reactos.org
Author: ion Date: Wed Oct 4 09:48:46 2006 New Revision: 24387 URL:
http://svn.reactos.org/svn/reactos?rev=24387&view=rev
Log: - Fix KUSER_SHARED_DATA in winddk.h - Scanfor NOEXECUTE/EXECUTE/OPTIN/OPTOUT/ALWAYSON/ALWAYSOFF load strings and set the appropriate NX policy in KUSER_SHARED_DATA as well as kernel CPU Feature flags. Modified: trunk/reactos/include/ddk/winddk.h trunk/reactos/include/ndk/ketypes.h trunk/reactos/ntoskrnl/ke/i386/cpu.c trunk/reactos/ntoskrnl/ke/i386/kiinit.c Modified: trunk/reactos/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=2…
============================================================================== --- trunk/reactos/include/ddk/winddk.h (original) +++ trunk/reactos/include/ddk/winddk.h Wed Oct 4 09:48:46 2006 @@ -458,6 +458,9 @@ LARGE_INTEGER SystemExpirationDate; ULONG SuiteMask; BOOLEAN KdDebuggerEnabled; +#if (NTDDI_VERSION >= NTDDI_WINXPSP2) + UCHAR NXSupportPolicy; +#endif volatile ULONG ActiveConsoleId; volatile ULONG DismountCount; ULONG ComPlusPackage; @@ -475,9 +478,29 @@ volatile ULONG64 TickCountQuad; }; ULONG Cookie; +#if (NTDDI_VERSION >= NTDDI_WS03) LONGLONG ConsoleSessionForegroundProcessId; ULONG Wow64SharedInformation[MAX_WOW64_SHARED_ENTRIES]; - ULONG UserModeGlobalLogging; +#endif +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + USHORT UserModeGlobalLogger[8]; + ULONG HeapTracingPid[2]; + ULONG CritSecTracingPid[2]; + union + { + ULONG SharedDataFlags; + struct + { + ULONG DbgErrorPortPresent:1; + ULONG DbgElevationEnabled:1; + ULONG DbgVirtEnabled:1; + ULONG DbgInstallerDetectEnabled:1; + ULONG SpareBits:28; + }; + }; + ULONG ImageFileExecutionOptions; + KAFFINITY ActiveProcessorAffinity; +#endif } KUSER_SHARED_DATA, *PKUSER_SHARED_DATA; /* Modified: trunk/reactos/include/ndk/ketypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ketypes.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/ketypes.h (original) +++ trunk/reactos/include/ndk/ketypes.h Wed Oct 4 09:48:46 2006 @@ -87,6 +87,8 @@ #define KF_3DNOW 0x00004000 #define KF_AMDK6MTRR 0x00008000 #define KF_XMMI64 0x00010000 +#define KF_NX_DISABLED 0x00400000 +#define KF_NX_ENABLED 0x00800000 // // KPCR Access for non-IA64 builds Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/cpu.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/cpu.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/cpu.c Wed Oct 4 09:48:46 2006 @@ -303,7 +303,7 @@ } else { - /* Familes below 5 don't support PGE, PSE or CMOV at all */ + /* Families below 5 don't support PGE, PSE or CMOV at all */ Reg[3] &= ~(0x08 | 0x2000 | 0x8000); /* They also don't support advanced CPUID functions. */ Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/kiinit.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c Wed Oct 4 09:48:46 2006 @@ -8,6 +8,7 @@ /* INCLUDES *****************************************************************/ +#define NTDDI_VERSION NTDDI_WS03SP1 #include <ntoskrnl.h> #define NDEBUG #include <debug.h> @@ -318,6 +319,36 @@ /* Save feature bits */ Prcb->FeatureBits = FeatureBits; + /* Set the default NX policy (opt-in) */ + SharedUserData->NXSupportPolicy = 2; + + /* Check if NPX is always on */ + if (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=ALWAYSON")) + { + /* Set it always on */ + SharedUserData->NXSupportPolicy = 1; + KeFeatureBits |= KF_NX_ENABLED; + } + else if (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=OPTOUT")) + { + /* Set it in opt-out mode */ + SharedUserData->NXSupportPolicy = 3; + KeFeatureBits |= KF_NX_ENABLED; + } + else if ((strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=OPTIN")) || + (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE"))) + { + /* Set the feature bits */ + KeFeatureBits |= KF_NX_ENABLED; + } + else if ((strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=ALWAYSOFF")) || + (strstr(KeLoaderBlock->LoadOptions, "EXECUTE"))) + { + /* Set disabled mode */ + SharedUserData->NXSupportPolicy = 0; + KeFeatureBits |= KF_NX_DISABLED; + } + /* Save CPU state */ KiSaveProcessorControlState(&Prcb->ProcessorState);
18 years, 2 months
1
0
0
0
[ion] 24386: - Add KF_XMMI64 feature flag for SSE2 and detect it. - Detect Hyper-Threading and set Local APIC ID (put back Thomas's code that he added in an old revision and that I had accidentally removed and forgotten to re-convert into the new KiGetFeatureBits function). - Add code to set the kernel MX Csr Mask in the FX Save Area. - Startup the sysenter handler on the DPC stack. - Detect and notify users with broken Pentiums. - Do some NPX checks to forcefully disable any FPU flags that migh
by ion@svn.reactos.org
Author: ion Date: Wed Oct 4 09:29:30 2006 New Revision: 24386 URL:
http://svn.reactos.org/svn/reactos?rev=24386&view=rev
Log: - Add KF_XMMI64 feature flag for SSE2 and detect it. - Detect Hyper-Threading and set Local APIC ID (put back Thomas's code that he added in an old revision and that I had accidentally removed and forgotten to re-convert into the new KiGetFeatureBits function). - Add code to set the kernel MX Csr Mask in the FX Save Area. - Startup the sysenter handler on the DPC stack. - Detect and notify users with broken Pentiums. - Do some NPX checks to forcefully disable any FPU flags that might be set (SSE, MMX, 3DNOW) if the NPX is disabled. Modified: trunk/reactos/include/ndk/ketypes.h trunk/reactos/ntoskrnl/include/internal/ke.h trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h trunk/reactos/ntoskrnl/ke/clock.c trunk/reactos/ntoskrnl/ke/i386/cpu.c trunk/reactos/ntoskrnl/ke/i386/kiinit.c trunk/reactos/ntoskrnl/ke/i386/trap.s Modified: trunk/reactos/include/ndk/ketypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ketypes.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/ketypes.h (original) +++ trunk/reactos/include/ndk/ketypes.h Wed Oct 4 09:29:30 2006 @@ -86,6 +86,7 @@ #define KF_XMMI 0x00002000 #define KF_3DNOW 0x00004000 #define KF_AMDK6MTRR 0x00008000 +#define KF_XMMI64 0x00010000 // // KPCR Access for non-IA64 builds Modified: trunk/reactos/ntoskrnl/include/internal/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ke.h (original) +++ trunk/reactos/ntoskrnl/include/internal/ke.h Wed Oct 4 09:29:30 2006 @@ -82,6 +82,7 @@ extern ULONG KeI386NpxPresent; extern ULONG KeI386XMMIPresent; extern ULONG KeI386FxsrPresent; +extern ULONG KiMXCsrMask; extern ULONG KeI386CpuType; extern ULONG KeI386CpuStep; extern ULONG KeProcessorArchitecture; @@ -89,6 +90,7 @@ extern ULONG KeProcessorRevision; extern ULONG KeFeatureBits; extern ULONG Ke386GlobalPagesEnabled; +extern BOOLEAN KiI386PentiumLockErrataPresent; extern KNODE KiNode0; extern PKNODE KeNodeBlock[1]; extern UCHAR KeNumberNodes; @@ -119,6 +121,7 @@ extern BOOLEAN KeThreadDpcEnable; extern LARGE_INTEGER KiTimeIncrementReciprocal; extern UCHAR KiTimeIncrementShiftCount; +extern ULONG KiTimeLimitIsrMicroseconds; extern LIST_ENTRY BugcheckCallbackListHead, BugcheckReasonCallbackListHead; extern KSPIN_LOCK BugCheckCallbackLock; extern KDPC KiExpireTimerDpc; @@ -861,6 +864,10 @@ KiInitMachineDependent(VOID); VOID +NTAPI +KiI386PentiumLockErrataFixup(VOID); + +VOID WRMSR( IN ULONG Register, IN LONGLONG Value Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h (original) +++ trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h Wed Oct 4 09:29:30 2006 @@ -318,6 +318,7 @@ C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, NpxThread) == KPCR_NPX_THREAD); C_ASSERT(FIELD_OFFSET(KTSS, Esp0) == KTSS_ESP0); C_ASSERT(FIELD_OFFSET(KTSS, IoMapBase) == KTSS_IOMAPBASE); +C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, DpcStack) == KPCR_PRCB_DPC_STACK); C_ASSERT(sizeof(FX_SAVE_AREA) == SIZEOF_FX_SAVE_AREA); #endif /* INCLUDE_INTERNAL_NTOSKRNL_H */ Modified: trunk/reactos/ntoskrnl/ke/clock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/clock.c?rev=24…
============================================================================== --- trunk/reactos/ntoskrnl/ke/clock.c (original) +++ trunk/reactos/ntoskrnl/ke/clock.c Wed Oct 4 09:29:30 2006 @@ -37,7 +37,7 @@ KDPC KiExpireTimerDpc; BOOLEAN KiClockSetupComplete = FALSE; - +ULONG KiTimeLimitIsrMicroseconds; /* * Number of timer interrupts since initialisation Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/cpu.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/cpu.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/cpu.c Wed Oct 4 09:29:30 2006 @@ -58,19 +58,21 @@ ULONG KeFeatureBits; ULONG KiFastSystemCallDisable = 1; ULONG KeI386NpxPresent = 0; +ULONG KiMXCsrMask = 0; ULONG MxcsrFeatureMask = 0; ULONG KeI386XMMIPresent = 0; ULONG KeI386FxsrPresent = 0; ULONG KeI386MachineType; ULONG Ke386Pae = FALSE; ULONG Ke386NoExecute = FALSE; -BOOLEAN KiI386PentiumLockErrataPresent; ULONG KeLargestCacheLine = 0x40; ULONG KeDcacheFlushCount = 0; ULONG KeIcacheFlushCount = 0; ULONG KiDmaIoCoherency = 0; CHAR KeNumberProcessors; KAFFINITY KeActiveProcessors = 1; +BOOLEAN KiI386PentiumLockErrataPresent; +BOOLEAN KiSMTProcessorsPresent; /* CPU Signatures */ CHAR CmpIntelID[] = "GenuineIntel"; @@ -255,6 +257,9 @@ /* Get the CPUID Info. Features are in Reg[3]. */ CPUID(Reg, 1); + /* Set the initial APIC ID */ + Prcb->InitialApicId = (UCHAR)(Reg[1] >> 24); + /* Check for AMD CPU */ if (Vendor == CPU_AMD) { @@ -351,6 +356,24 @@ if (CpuFeatures & 0x00800000) FeatureBits |= KF_MMX; if (CpuFeatures & 0x01000000) FeatureBits |= KF_FXSR; if (CpuFeatures & 0x02000000) FeatureBits |= KF_XMMI; + if (CpuFeatures & 0x04000000) FeatureBits |= KF_XMMI64; + + /* Check if the CPU has hyper-threading */ + if (CpuFeatures & 0x10000000) + { + /* Set the number of logical CPUs */ + Prcb->LogicalProcessorsPerPhysicalProcessor = (UCHAR)(Reg[1] >> 16); + if (Prcb->LogicalProcessorsPerPhysicalProcessor > 1) + { + /* We're on dual-core */ + KiSMTProcessorsPresent = TRUE; + } + } + else + { + /* We only have a single CPU */ + Prcb->LogicalProcessorsPerPhysicalProcessor = 1; + } /* Check if CPUID 0x80000000 is supported */ if (ExtendedCPUID) @@ -765,7 +788,7 @@ { /* Set CS and ESP */ Ke386Wrmsr(0x174, KGDT_R0_CODE, 0); - Ke386Wrmsr(0x175, 0, 0); + Ke386Wrmsr(0x175, KeGetCurrentPrcb()->DpcStack, 0); /* Set LSTAR */ Ke386Wrmsr(0x176, KiFastCallEntry, 0); @@ -811,6 +834,14 @@ /* FIXME: Support this */ DPRINT1("Your machine supports XMMI exceptions but ReactOS doesn't\n"); return 0; +} + +VOID +NTAPI +KiI386PentiumLockErrataFixup(VOID) +{ + /* FIXME: Support this */ + DPRINT1("WARNING: Your machine has a CPU bug that ReactOS can't bypass!\n"); } /* PUBLIC FUNCTIONS **********************************************************/ Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/kiinit.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c Wed Oct 4 09:29:30 2006 @@ -30,6 +30,8 @@ NTSTATUS Status; //ULONG ReturnLength; ULONG i, Affinity; + PFX_SAVE_AREA FxSaveArea; + ULONG MXCsrMask = 0xFFBF, NewMask; /* Check for large page support */ if (KeFeatureBits & KF_LARGE_PAGE) @@ -69,6 +71,30 @@ /* Check for PAT support and enable it */ if (KeFeatureBits & KF_PAT) KiInitializePAT(); + /* Assume no errata for now */ + SharedUserData->ProcessorFeatures[PF_FLOATING_POINT_PRECISION_ERRATA] = 0; + + /* If there's no NPX, then we're emulating the FPU */ + SharedUserData->ProcessorFeatures[PF_FLOATING_POINT_EMULATED] = + !KeI386NpxPresent; + + /* Check if there's no NPX, so that we can disable associated features */ + if (!KeI386NpxPresent) + { + /* Remove NPX-related bits */ + KeFeatureBits &= ~(KF_XMMI64 | KF_XMMI | KF_FXSR | KF_MMX); + + /* Disable kernel flags */ + KeI386FxsrPresent = KeI386XMMIPresent = FALSE; + + /* Disable processor features that might've been set until now */ + SharedUserData->ProcessorFeatures[PF_FLOATING_POINT_PRECISION_ERRATA] = + SharedUserData->ProcessorFeatures[PF_XMMI64_INSTRUCTIONS_AVAILABLE] = + SharedUserData->ProcessorFeatures[PF_XMMI_INSTRUCTIONS_AVAILABLE] = + SharedUserData->ProcessorFeatures[PF_3DNOW_INSTRUCTIONS_AVAILABLE] = + SharedUserData->ProcessorFeatures[PF_MMX_INSTRUCTIONS_AVAILABLE] = 0; + } + /* Check for CR4 support */ if (KeFeatureBits & KF_CR4) { @@ -143,12 +169,67 @@ /* Check if we have AMD MTRR and initialize it for the CPU */ if (KeFeatureBits & KF_AMDK6MTRR) KiAmdK6InitializeMTRR(); - /* FIXME: Apply P5 LOCK Errata fixups */ + /* Check if this is a buggy Pentium and apply the fixup if so */ + if (KiI386PentiumLockErrataPresent) KiI386PentiumLockErrataFixup(); + + /* Get the current thread NPX state */ + FxSaveArea = (PVOID) + ((ULONG_PTR)KeGetCurrentThread()->InitialStack - + NPX_FRAME_LENGTH); + + /* Clear initial MXCsr mask */ + FxSaveArea->U.FxArea.MXCsrMask = 0; + + /* Save the current NPX State */ +#ifdef __GNUC__ + asm volatile("fxsave %0\n\t" : "=m" (*FxSaveArea)); +#else + __asm fxsave [FxSaveArea] +#endif + /* Check if the current mask doesn't match the reserved bits */ + if (FxSaveArea->U.FxArea.MXCsrMask != MXCsrMask) + { + /* Then use whatever it's holding */ + MXCsrMask = FxSaveArea->U.FxArea.MXCsrMask; + } + + /* Check if nobody set the kernel-wide mask */ + if (!KiMXCsrMask) + { + /* Then use the one we calculated above */ + NewMask = MXCsrMask; + } + else + { + /* Use the existing mask */ + NewMask = KiMXCsrMask; + + /* Was it set to the same value we found now? */ + if (NewMask != MXCsrMask) + { + /* No, something is definitely wrong */ + KEBUGCHECKEX(MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED, + KF_FXSR, + NewMask, + MXCsrMask, + 0); + } + } + + /* Now set the kernel mask */ + KiMXCsrMask = NewMask & MXCsrMask; } } /* Return affinity back to where it was */ KeRevertToUserAffinityThread(); + + /* NT allows limiting the duration of an ISR with a registry key */ + if (KiTimeLimitIsrMicroseconds) + { + /* FIXME: TODO */ + DPRINT1("ISR Time Limit not yet supported\n"); + } } VOID @@ -519,11 +600,17 @@ /* Align stack and make space for the trap frame and NPX frame */ InitialStack &= ~KTRAP_FRAME_ALIGN; +#ifdef __GNUC__ __asm__ __volatile__("movl %0,%%esp" : :"r" (InitialStack)); __asm__ __volatile__("subl %0,%%esp" : :"r" (NPX_FRAME_LENGTH + KTRAP_FRAME_LENGTH + KTRAP_FRAME_ALIGN)); __asm__ __volatile__("push %0" : :"r" (CR0_EM + CR0_TS + CR0_MP)); +#else + __asm mov esp, InitialStack; + __asm sub esp, NPX_FRAME_LENGTH + KTRAP_FRAME_ALIGN + KTRAP_FRAME_LENGTH; + __asm push CR0_EM + CR0_TS + CR0_MP +#endif /* Call main kernel initialization */ KiInitializeKernel(&KiInitialProcess.Pcb, Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?re…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/trap.s (original) +++ trunk/reactos/ntoskrnl/ke/i386/trap.s Wed Oct 4 09:29:30 2006 @@ -111,9 +111,13 @@ /* Set FS to PCR */ mov ecx, KGDT_R0_PCR mov fs, cx + //push KGDT_R0_PCR + //pop fs + + /* Set user selector */ + mov ecx, KGDT_R3_DATA | RPL_MASK /* Set DS/ES to User Selector */ - mov ecx, KGDT_R3_DATA | RPL_MASK mov ds, cx mov es, cx
18 years, 2 months
1
0
0
0
[ion] 24385: - Make Kernel initialization (KeInit2) portable/more complete. KeInit2 becomes KeInitSystem, the portable part, with a call to KiInitMachineDependent, the arch-specific part. - Do all CPU configuration through IPIs and synchronize with potential multiple CPUs. - Add mtrr.c and patpge.c for future support of MTRR, AMD K6 MTRR, PGE and PAT support, with initilization calls in each of them (which only print out a "Sorry" message). - Add some stubbed code for extra initizliation to do l
by ion@svn.reactos.org
Author: ion Date: Wed Oct 4 07:37:11 2006 New Revision: 24385 URL:
http://svn.reactos.org/svn/reactos?rev=24385&view=rev
Log: - Make Kernel initialization (KeInit2) portable/more complete. KeInit2 becomes KeInitSystem, the portable part, with a call to KiInitMachineDependent, the arch-specific part. - Do all CPU configuration through IPIs and synchronize with potential multiple CPUs. - Add mtrr.c and patpge.c for future support of MTRR, AMD K6 MTRR, PGE and PAT support, with initilization calls in each of them (which only print out a "Sorry" message). - Add some stubbed code for extra initizliation to do later once some detection things are fixed. Added: trunk/reactos/ntoskrnl/ke/i386/mtrr.c trunk/reactos/ntoskrnl/ke/i386/patpge.c Modified: trunk/reactos/ntoskrnl/ex/init.c trunk/reactos/ntoskrnl/include/internal/ke.h trunk/reactos/ntoskrnl/ke/dpc.c trunk/reactos/ntoskrnl/ke/i386/cpu.c trunk/reactos/ntoskrnl/ke/i386/kiinit.c trunk/reactos/ntoskrnl/ke/krnlinit.c trunk/reactos/ntoskrnl/ntoskrnl.rbuild Modified: trunk/reactos/ntoskrnl/ex/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/init.c?rev=243…
============================================================================== --- trunk/reactos/ntoskrnl/ex/init.c (original) +++ trunk/reactos/ntoskrnl/ex/init.c Wed Oct 4 07:37:11 2006 @@ -736,8 +736,8 @@ /* Set us at maximum priority */ KeSetPriorityThread(KeGetCurrentThread(), HIGH_PRIORITY); - /* Initialize the second stage of the kernel */ - KeInit2(); + /* Initialize the later stages of the kernel */ + KeInitSystem(); /* Initialize all processors */ HalAllProcessorsStarted(); Modified: trunk/reactos/ntoskrnl/include/internal/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ke.h (original) +++ trunk/reactos/ntoskrnl/include/internal/ke.h Wed Oct 4 07:37:11 2006 @@ -116,6 +116,7 @@ extern ULONG KiMinimumDpcRate; extern ULONG KiAdjustDpcThreshold; extern ULONG KiIdealDpcRate; +extern BOOLEAN KeThreadDpcEnable; extern LARGE_INTEGER KiTimeIncrementReciprocal; extern UCHAR KiTimeIncrementShiftCount; extern LIST_ENTRY BugcheckCallbackListHead, BugcheckReasonCallbackListHead; @@ -135,6 +136,7 @@ extern ULONG KiIdleSummary; extern VOID KiTrap8(VOID); extern VOID KiTrap2(VOID); +extern VOID KiFastCallEntry(VOID); extern PVOID KeUserApcDispatcher; extern PVOID KeUserCallbackDispatcher; extern PVOID KeUserExceptionDispatcher; @@ -550,10 +552,6 @@ KPRIORITY Increment ); -PULONG -NTAPI -KeGetStackTopThread(struct _ETHREAD* Thread); - VOID NTAPI KeContextToTrapFrame( @@ -638,6 +636,10 @@ VOID NTAPI +KeInitSystem(VOID); + +VOID +NTAPI KeInitExceptions(VOID); VOID @@ -646,33 +648,17 @@ VOID NTAPI -KeInitTimer(VOID); - -VOID -NTAPI -KeInitDispatcher(VOID); +KiInitializeBugCheck(VOID); VOID NTAPI KiInitializeSystemClock(VOID); - -VOID -NTAPI -KiInitializeBugCheck(VOID); - -VOID -NTAPI -Phase1Initialization(PVOID Context); VOID NTAPI KiSystemStartup( IN PLOADER_PARAMETER_BLOCK LoaderBlock ); - -VOID -NTAPI -KeInit2(VOID); BOOLEAN NTAPI @@ -709,33 +695,6 @@ IN PKEXCEPTION_FRAME ExceptionFrame, IN OUT PCONTEXT Context ); - -VOID -NTAPI -KeApplicationProcessorInit(VOID); - -VOID -NTAPI -KePrepareForApplicationProcessorInit(ULONG id); - -ULONG -NTAPI -KiUserTrapHandler( - PKTRAP_FRAME Tf, - ULONG ExceptionNr, - PVOID Cr2 -); - -VOID -NTAPI -KePushAndStackSwitchAndSysRet( - ULONG Push, - PVOID NewStack -); - -VOID -NTAPI -KeStackSwitchAndRet(PVOID NewStack); VOID NTAPI @@ -813,7 +772,6 @@ VOID ); - VOID NTAPI KiInitializeMachineType( @@ -866,6 +824,48 @@ VOID ); +ULONG_PTR +NTAPI +Ki386EnableGlobalPage(IN volatile ULONG_PTR Context); + +VOID +NTAPI +KiInitializePAT(VOID); + +VOID +NTAPI +KiInitializeMTRR(IN BOOLEAN FinalCpu); + +VOID +NTAPI +KiAmdK6InitializeMTRR(VOID); + +VOID +NTAPI +KiRestoreFastSyscallReturnState(VOID); + +ULONG_PTR +NTAPI +Ki386EnableDE(IN ULONG_PTR Context); + +ULONG_PTR +NTAPI +Ki386EnableFxsr(IN ULONG_PTR Context); + +ULONG_PTR +NTAPI +Ki386EnableXMMIExceptions(IN ULONG_PTR Context); + +VOID +NTAPI +KiInitMachineDependent(VOID); + +VOID +WRMSR( + IN ULONG Register, + IN LONGLONG Value +); + #include "ke_x.h" #endif /* __NTOSKRNL_INCLUDE_INTERNAL_KE_H */ Modified: trunk/reactos/ntoskrnl/ke/dpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/dpc.c?rev=2438…
============================================================================== --- trunk/reactos/ntoskrnl/ke/dpc.c (original) +++ trunk/reactos/ntoskrnl/ke/dpc.c Wed Oct 4 07:37:11 2006 @@ -22,6 +22,7 @@ ULONG KiMinimumDpcRate = 3; ULONG KiAdjustDpcThreshold = 20; ULONG KiIdealDpcRate = 20; +BOOLEAN KeThreadDpcEnable; KMUTEX KiGenericCallDpcMutex; /* PRIVATE FUNCTIONS *********************************************************/ Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/cpu.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/cpu.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/cpu.c Wed Oct 4 07:37:11 2006 @@ -63,7 +63,6 @@ ULONG KeI386FxsrPresent = 0; ULONG KeI386MachineType; ULONG Ke386Pae = FALSE; -ULONG Ke386GlobalPagesEnabled = FALSE; ULONG Ke386NoExecute = FALSE; BOOLEAN KiI386PentiumLockErrataPresent; ULONG KeLargestCacheLine = 0x40; @@ -760,6 +759,60 @@ KeI386MachineType = KeLoaderBlock->u.I386.MachineType & 0x000FF; } +ULONG_PTR +NTAPI +KiLoadFastSyscallMachineSpecificRegisters(IN ULONG_PTR Context) +{ + /* Set CS and ESP */ + Ke386Wrmsr(0x174, KGDT_R0_CODE, 0); + Ke386Wrmsr(0x175, 0, 0); + + /* Set LSTAR */ + Ke386Wrmsr(0x176, KiFastCallEntry, 0); + return 0; +} + +VOID +NTAPI +KiRestoreFastSyscallReturnState(VOID) +{ + /* FIXME: NT has support for SYSCALL, IA64-SYSENTER, etc. */ + + /* Check if the CPU Supports fast system call */ + if (KeFeatureBits & KF_FAST_SYSCALL) + { + /* Do an IPI to enable it */ + KeIpiGenericCall(KiLoadFastSyscallMachineSpecificRegisters, 0); + } +} + +ULONG_PTR +NTAPI +Ki386EnableDE(IN ULONG_PTR Context) +{ + /* Enable DE */ + Ke386SetCr4(Ke386GetCr4() | CR4_DE); + return 0; +} + +ULONG_PTR +NTAPI +Ki386EnableFxsr(IN ULONG_PTR Context) +{ + /* Enable FXSR */ + Ke386SetCr4(Ke386GetCr4() | CR4_FXSR); + return 0; +} + +ULONG_PTR +NTAPI +Ki386EnableXMMIExceptions(IN ULONG_PTR Context) +{ + /* FIXME: Support this */ + DPRINT1("Your machine supports XMMI exceptions but ReactOS doesn't\n"); + return 0; +} + /* PUBLIC FUNCTIONS **********************************************************/ /* Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/kiinit.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c Wed Oct 4 07:37:11 2006 @@ -19,6 +19,137 @@ KSPIN_LOCK Ki486CompatibilityLock; /* FUNCTIONS *****************************************************************/ + +VOID +NTAPI +KiInitMachineDependent(VOID) +{ + ULONG Protect; + ULONG CpuCount; + BOOLEAN FbCaching = FALSE; + NTSTATUS Status; + //ULONG ReturnLength; + ULONG i, Affinity; + + /* Check for large page support */ + if (KeFeatureBits & KF_LARGE_PAGE) + { + /* FIXME: Support this */ + DPRINT1("Your machine supports PGE but ReactOS doesn't yet.\n"); + } + + /* Check for global page support */ + if (KeFeatureBits & KF_GLOBAL_PAGE) + { + /* Do an IPI to enable it on all CPUs */ + CpuCount = KeNumberProcessors; + KeIpiGenericCall(Ki386EnableGlobalPage, (ULONG_PTR)&CpuCount); + } + + /* Check for PAT and/or MTRR support */ + if (KeFeatureBits & (KF_PAT | KF_MTRR)) + { + /* FIXME: ROS HAL Doesn't initialize this! */ +#if 1 + Status = STATUS_UNSUCCESSFUL; +#else + /* Query the HAL to make sure we can use it */ + Status = HalQuerySystemInformation(HalFrameBufferCachingInformation, + sizeof(BOOLEAN), + &FbCaching, + &ReturnLength); +#endif + if ((NT_SUCCESS(Status)) && (FbCaching)) + { + /* We can't, disable it */ + KeFeatureBits &= ~(KF_PAT | KF_MTRR); + } + } + + /* Check for PAT support and enable it */ + if (KeFeatureBits & KF_PAT) KiInitializePAT(); + + /* Check for CR4 support */ + if (KeFeatureBits & KF_CR4) + { + /* Do an IPI call to enable the Debug Exceptions */ + CpuCount = KeNumberProcessors; + KeIpiGenericCall(Ki386EnableDE, (ULONG_PTR)&CpuCount); + } + + /* Check if FXSR was found */ + if (KeFeatureBits & KF_FXSR) + { + /* Do an IPI call to enable the FXSR */ + CpuCount = KeNumberProcessors; + KeIpiGenericCall(Ki386EnableFxsr, (ULONG_PTR)&CpuCount); + + /* Check if XMM was found too */ + if (KeFeatureBits & KF_XMMI) + { + /* Do an IPI call to enable XMMI exceptions */ + CpuCount = KeNumberProcessors; + KeIpiGenericCall(Ki386EnableXMMIExceptions, (ULONG_PTR)&CpuCount); + + /* FIXME: Implement and enable XMM Page Zeroing for Mm */ + + /* Patch the RtlPrefetchMemoryNonTemporal routine to enable it */ + Protect = MmGetPageProtect(NULL, RtlPrefetchMemoryNonTemporal); + MmSetPageProtect(NULL, + RtlPrefetchMemoryNonTemporal, + Protect | PAGE_IS_WRITABLE); + *(PCHAR)RtlPrefetchMemoryNonTemporal = 0x90; + MmSetPageProtect(NULL, RtlPrefetchMemoryNonTemporal, Protect); + } + } + + /* Check for, and enable SYSENTER support */ + KiRestoreFastSyscallReturnState(); + + /* Loop every CPU */ + i = KeActiveProcessors; + for (Affinity = 1; i; Affinity <<= 1) + { + /* Check if this is part of the set */ + if (i & Affinity) + { + /* Run on this CPU */ + i &= ~Affinity; + KeSetSystemAffinityThread(Affinity); + + /* Reset MHz to 0 for this CPU */ + KeGetCurrentPrcb()->MHz = 0; + + /* Check if we can use RDTSC */ + if (KeFeatureBits & KF_RDTSC) + { + /* Start sampling loop */ + for (;;) + { + // + // FIXME: TODO + // + break; + } + } + + /* Check if we have MTRR without PAT */ + if (!(KeFeatureBits & KF_PAT) && (KeFeatureBits & KF_MTRR)) + { + /* Then manually initialize MTRR for the CPU */ + KiInitializeMTRR((BOOLEAN)i); + } + + /* Check if we have AMD MTRR and initialize it for the CPU */ + if (KeFeatureBits & KF_AMDK6MTRR) KiAmdK6InitializeMTRR(); + + /* FIXME: Apply P5 LOCK Errata fixups */ + } + } + + /* Return affinity back to where it was */ + KeRevertToUserAffinityThread(); +} VOID NTAPI Added: trunk/reactos/ntoskrnl/ke/i386/mtrr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/mtrr.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/mtrr.c (added) +++ trunk/reactos/ntoskrnl/ke/i386/mtrr.c Wed Oct 4 07:37:11 2006 @@ -1,0 +1,33 @@ +/* +* PROJECT: ReactOS Kernel +* LICENSE: GPL - See COPYING in the top level directory +* FILE: ntoskrnl/ke/i386/mtrr.c +* PURPOSE: Support for MTRR and AMD K6 MTRR +* PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) +*/ + +/* INCLUDES ******************************************************************/ + +#include <ntoskrnl.h> +#define NDEBUG +#include <debug.h> + +/* GLOBALS *******************************************************************/ + +/* FUNCTIONS *****************************************************************/ + +VOID +NTAPI +KiInitializeMTRR(IN BOOLEAN FinalCpu) +{ + /* FIXME: Support this */ + DPRINT1("Your machine supports MTRR but ReactOS doesn't yet.\n"); +} + +VOID +NTAPI +KiAmdK6InitializeMTRR(VOID) +{ + /* FIXME: Support this */ + DPRINT1("Your machine supports AMD MTRR but ReactOS doesn't yet.\n"); +} Added: trunk/reactos/ntoskrnl/ke/i386/patpge.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/patpge.c?…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/patpge.c (added) +++ trunk/reactos/ntoskrnl/ke/i386/patpge.c Wed Oct 4 07:37:11 2006 @@ -1,0 +1,63 @@ +/* +* PROJECT: ReactOS Kernel +* LICENSE: GPL - See COPYING in the top level directory +* FILE: ntoskrnl/ke/i386/patpge.c +* PURPOSE: Support for PAT and PGE (Large Pages) +* PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) +*/ + +/* INCLUDES ******************************************************************/ + +#include <ntoskrnl.h> +#define NDEBUG +#include <debug.h> + +/* GLOBALS *******************************************************************/ + +ULONG Ke386GlobalPagesEnabled; + +/* FUNCTIONS *****************************************************************/ + +ULONG_PTR +NTAPI +Ki386EnableGlobalPage(IN volatile ULONG_PTR Context) +{ + volatile PLONG Count = (PLONG)Context; + ULONG Cr4, Cr3; + + /* Disable interrupts */ + _disable(); + + /* Decrease CPU Count and loop until it's reached 0 */ + do {InterlockedDecrement(Count);} while (!*Count); + + /* Now check if this is the Boot CPU */ + if (!KeGetPcr()->Number) + { + /* It is.FIXME: Patch KeFlushCurrentTb */ + } + + /* Now get CR4 and make sure PGE is masked out */ + Cr4 = Ke386GetCr4(); + Ke386SetCr4(Cr4 & ~CR4_PGE); + + /* Flush the TLB */ + Ke386GetPageTableDirectory(Cr3); + Ke386SetPageTableDirectory(Cr3); + + /* Now enable PGE */ + Ke386SetCr4(Cr4 | CR4_PGE); + Ke386GlobalPagesEnabled = TRUE; + + /* Restore interrupts */ + _enable(); + return 0; +} + +VOID +NTAPI +KiInitializePAT(VOID) +{ + /* FIXME: Support this */ + DPRINT1("Your machine supports PAT but ReactOS doesn't yet.\n"); +} Modified: trunk/reactos/ntoskrnl/ke/krnlinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/krnlinit.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/krnlinit.c (original) +++ trunk/reactos/ntoskrnl/ke/krnlinit.c Wed Oct 4 07:37:11 2006 @@ -6,7 +6,7 @@ * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) */ -/* INCLUDES *****************************************************************/ +/* INCLUDES ******************************************************************/ #include <ntoskrnl.h> #define NDEBUG @@ -273,63 +273,18 @@ } } -/* FIXME: Rename and make portable */ VOID NTAPI -KeInit2(VOID) -{ - ULONG Protect; - - /* Check if Fxsr was found */ - if (KeI386FxsrPresent) - { - /* Enable it. FIXME: Send an IPI */ - Ke386SetCr4(Ke386GetCr4() | X86_CR4_OSFXSR); - - /* Check if XMM was found too */ - if (KeI386XMMIPresent) - { - /* Enable it: FIXME: Send an IPI. */ - Ke386SetCr4(Ke386GetCr4() | X86_CR4_OSXMMEXCPT); - - /* FIXME: Implement and enable XMM Page Zeroing for Mm */ - } - } - - if (KeFeatureBits & KF_GLOBAL_PAGE) - { - ULONG Flags; - /* Enable global pages */ - Ke386GlobalPagesEnabled = TRUE; - Ke386SaveFlags(Flags); - Ke386DisableInterrupts(); - Ke386SetCr4(Ke386GetCr4() | X86_CR4_PGE); - Ke386RestoreFlags(Flags); - } - - if (KeFeatureBits & KF_FAST_SYSCALL) - { - extern void KiFastCallEntry(void); - - /* CS Selector of the target segment. */ - Ke386Wrmsr(0x174, KGDT_R0_CODE, 0); - /* Target ESP. */ - Ke386Wrmsr(0x175, 0, 0); - /* Target EIP. */ - Ke386Wrmsr(0x176, (ULONG_PTR)KiFastCallEntry, 0); - } - - /* Does the CPU Support 'prefetchnta' (SSE) */ - if(KeFeatureBits & KF_XMMI) - { - Protect = MmGetPageProtect(NULL, (PVOID)RtlPrefetchMemoryNonTemporal); - MmSetPageProtect(NULL, (PVOID)RtlPrefetchMemoryNonTemporal, Protect | PAGE_IS_WRITABLE); - /* Replace the ret by a nop */ - *(PCHAR)RtlPrefetchMemoryNonTemporal = 0x90; - MmSetPageProtect(NULL, (PVOID)RtlPrefetchMemoryNonTemporal, Protect); - } - - /* Set IDT to writable */ - Protect = MmGetPageProtect(NULL, (PVOID)KiIdt); - MmSetPageProtect(NULL, (PVOID)KiIdt, Protect | PAGE_IS_WRITABLE); -} +KeInitSystem(VOID) +{ + /* Check if Threaded DPCs are enabled */ + if (KeThreadDpcEnable) + { + /* FIXME: TODO */ + DPRINT1("Threaded DPCs not yet supported\n"); + } + + /* Initialize non-portable parts of the kernel */ + KiInitMachineDependent(); +} + Modified: trunk/reactos/ntoskrnl/ntoskrnl.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.rbuild?r…
============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl.rbuild (original) +++ trunk/reactos/ntoskrnl/ntoskrnl.rbuild Wed Oct 4 07:37:11 2006 @@ -37,6 +37,8 @@ <!-- <file>irq.c</file> --> <file>kiinit.c</file> <file>ldt.c</file> + <file>mtrr.c</file> + <file>patpge.c</file> <file>thread.c</file> <file>trap.s</file> <file>usercall_asm.S</file>
18 years, 2 months
1
0
0
0
[gedmurphy] 24384: update comctl32 to Wine-0.9.22 to get the new imagelist code.
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Wed Oct 4 02:46:26 2006 New Revision: 24384 URL:
http://svn.reactos.org/svn/reactos?rev=24384&view=rev
Log: update comctl32 to Wine-0.9.22 to get the new imagelist code. Modified: trunk/reactos/dll/win32/comctl32/comctl32.h trunk/reactos/dll/win32/comctl32/comctl_Pl.rc trunk/reactos/dll/win32/comctl32/commctrl.c trunk/reactos/dll/win32/comctl32/header.c trunk/reactos/dll/win32/comctl32/imagelist.c trunk/reactos/dll/win32/comctl32/toolbar.c Modified: trunk/reactos/dll/win32/comctl32/comctl32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl3…
============================================================================== --- trunk/reactos/dll/win32/comctl32/comctl32.h (original) +++ trunk/reactos/dll/win32/comctl32/comctl32.h Wed Oct 4 02:46:26 2006 @@ -143,6 +143,7 @@ HWND COMCTL32_CreateToolTip (HWND); VOID COMCTL32_RefreshSysColors(void); void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark, BOOL bHorizontal); +void COMCTL32_EnsureBitmapSize(HBITMAP *pBitmap, int cxMinWidth, int cyMinHeight, COLORREF crBackground); INT Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen); BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc); BOOL Str_SetPtrWtoA (LPSTR *lppDest, LPCWSTR lpSrc); Modified: trunk/reactos/dll/win32/comctl32/comctl_Pl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl_…
============================================================================== --- trunk/reactos/dll/win32/comctl32/comctl_Pl.rc (original) +++ trunk/reactos/dll/win32/comctl32/comctl_Pl.rc Wed Oct 4 02:46:26 2006 @@ -81,3 +81,8 @@ { IDS_SEPARATOR "Odstêp" } + +STRINGTABLE DISCARDABLE +{ + HKY_NONE "Brak" +} Modified: trunk/reactos/dll/win32/comctl32/commctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/commctr…
============================================================================== --- trunk/reactos/dll/win32/comctl32/commctrl.c (original) +++ trunk/reactos/dll/win32/comctl32/commctrl.c Wed Oct 4 02:46:26 2006 @@ -1449,6 +1449,67 @@ } /*********************************************************************** + * COMCTL32_EnsureBitmapSize [internal] + * + * If needed enlarge the bitmap so that the width is at least cxMinWidth + * the height is at least cyMinHeight. If the bitmap already have these + * dimensions nothing changes. + * + * PARAMS + * hBitmap [I/O] Bitmap to modify. The handle may change + * cxMinWidth [I] If the width of the bitmap is smaller then it will + * be enlarged to this value + * cyMinHeight [I] If the height of the bitmap is smaller then it will + * be enlarged to this value + * cyBackground [I] The color with which the new area will be filled + * + * RETURNS + * none + */ +void COMCTL32_EnsureBitmapSize(HBITMAP *pBitmap, int cxMinWidth, int cyMinHeight, COLORREF crBackground) +{ + int cxNew, cyNew; + BITMAP bmp; + HBITMAP hNewBitmap; + HBITMAP hNewDCBitmap, hOldDCBitmap; + HBRUSH hNewDCBrush; + HDC hdcNew, hdcOld; + + if (!GetObjectW(*pBitmap, sizeof(BITMAP), &bmp)) + return; + cxNew = (cxMinWidth > bmp.bmWidth ? cxMinWidth : bmp.bmWidth); + cyNew = (cyMinHeight > bmp.bmHeight ? cyMinHeight : bmp.bmHeight); + if (cxNew == bmp.bmWidth && cyNew == bmp.bmHeight) + return; + + hdcNew = CreateCompatibleDC(NULL); + hNewBitmap = CreateBitmap(cxNew, cyNew, bmp.bmPlanes, bmp.bmBitsPixel, NULL); + hNewDCBitmap = SelectObject(hdcNew, hNewBitmap); + hNewDCBrush = SelectObject(hdcNew, CreateSolidBrush(crBackground)); + + hdcOld = CreateCompatibleDC(NULL); + hOldDCBitmap = SelectObject(hdcOld, *pBitmap); + + BitBlt(hdcNew, 0, 0, bmp.bmWidth, bmp.bmHeight, hdcOld, 0, 0, SRCCOPY); + if (bmp.bmWidth < cxMinWidth) + PatBlt(hdcNew, bmp.bmWidth, 0, cxNew, bmp.bmHeight, PATCOPY); + if (bmp.bmHeight < cyMinHeight) + PatBlt(hdcNew, 0, bmp.bmHeight, bmp.bmWidth, cyNew, PATCOPY); + if (bmp.bmWidth < cxMinWidth && bmp.bmHeight < cyMinHeight) + PatBlt(hdcNew, bmp.bmWidth, bmp.bmHeight, cxNew, cyNew, PATCOPY); + + SelectObject(hdcNew, hNewDCBitmap); + DeleteObject(SelectObject(hdcNew, hNewDCBrush)); + DeleteDC(hdcNew); + SelectObject(hdcOld, hOldDCBitmap); + DeleteDC(hdcOld); + + DeleteObject(*pBitmap); + *pBitmap = hNewBitmap; + return; +} + +/*********************************************************************** * MirrorIcon [COMCTL32.414] * * Mirrors an icon so that it will appear correctly on a mirrored DC. Modified: trunk/reactos/dll/win32/comctl32/header.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/header.…
============================================================================== --- trunk/reactos/dll/win32/comctl32/header.c (original) +++ trunk/reactos/dll/win32/comctl32/header.c Wed Oct 4 02:46:26 2006 @@ -4,6 +4,7 @@ * Copyright 1998 Eric Kohl * Copyright 2000 Eric Kohl for CodeWeavers * Copyright 2003 Maxime Bellenge + * Copyright 2006 Mikolaj Zalewski * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,15 +21,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * TODO: - * - Imagelist support (partially). - * - Callback items (under construction). - * - Hottrack support (partially). - * - Custom draw support (including Notifications). - * - Drag and Drop support (including Notifications). - * - New messages. - * - Use notification format - * - Correct the order maintenance code to preserve valid order - * + * - Imagelist support (completed?) + * - Hottrack support (completed?) + * - Custom draw support (completed?) + * - Filters support (HDS_FILTER, HDI_FILTER, HDM_*FILTER*, HDN_*FILTER*) + * - New Windows Vista features */ #include <stdarg.h> @@ -84,7 +81,6 @@ INT iMoveItem; /* index of tracked item. (Tracking mode) */ INT xTrackOffset; /* distance between the right side of the tracked item and the cursor */ INT xOldTrack; /* track offset (see above) after the last WM_MOUSEMOVE */ - INT nOldWidth; /* width of a sizing item after the last WM_MOUSEMOVE */ INT iHotItem; /* index of hot item (cursor is over this item) */ INT iHotDivider; /* index of the hot divider (used while dragging an item or by HDM_SETHOTDIVIDER) */ INT iMargin; /* width of the margin that surrounds a bitmap */ @@ -802,32 +798,11 @@ } static BOOL -HEADER_SendHeaderNotifyT (HWND hwnd, UINT code, INT iItem, INT mask, HDITEMW *lpItem) +HEADER_SendNotifyWithHDItemT(HWND hwnd, UINT code, INT iItem, HDITEMW *lpItem) { HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); NMHEADERW nmhdr; - HDITEMW nmitem; - if (lpItem == NULL) - { - /* lpItem == NULL means that we should take the actual data from the item */ - if (mask & HDI_TEXT) - { - FIXME("(): invalid parameters - lpItem == NULL and (mask & HDI_TEXT)\n"); - mask &= ~HDI_TEXT; - } - nmitem.mask = mask; - nmitem.cxy = infoPtr->items[iItem].cxy; - nmitem.hbm = infoPtr->items[iItem].hbm; - nmitem.pszText = NULL; - nmitem.cchTextMax = 0; - nmitem.fmt = infoPtr->items[iItem].fmt; - nmitem.lParam = infoPtr->items[iItem].lParam; - nmitem.iOrder = infoPtr->items[iItem].iOrder; - nmitem.iImage = infoPtr->items[iItem].iImage; - lpItem = &nmitem; - } - nmhdr.hdr.hwndFrom = hwnd; nmhdr.hdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID); nmhdr.hdr.code = (infoPtr->nNotifyFormat == NFR_UNICODE ? code : HEADER_NotifyCodeWtoA(code)); @@ -837,6 +812,38 @@ return (BOOL)SendMessageW (infoPtr->hwndNotify, WM_NOTIFY, (WPARAM)nmhdr.hdr.idFrom, (LPARAM)&nmhdr); +} + +static BOOL +HEADER_SendNotifyWithIntFieldT(HWND hwnd, UINT code, INT iItem, INT mask, INT iValue) +{ + HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); + HDITEMW nmitem; + + /* copying only the iValue should be ok but to make the code more robust we copy everything */ + nmitem.cxy = infoPtr->items[iItem].cxy; + nmitem.hbm = infoPtr->items[iItem].hbm; + nmitem.pszText = NULL; + nmitem.cchTextMax = 0; + nmitem.fmt = infoPtr->items[iItem].fmt; + nmitem.lParam = infoPtr->items[iItem].lParam; + nmitem.iOrder = infoPtr->items[iItem].iOrder; + nmitem.iImage = infoPtr->items[iItem].iImage; + + nmitem.mask = mask; + switch (mask) + { + case HDI_WIDTH: + nmitem.cxy = iValue; + break; + case HDI_ORDER: + nmitem.iOrder = iValue; + break; + default: + ERR("invalid mask value 0x%x\n", iValue); + } + + return HEADER_SendNotifyWithHDItemT(hwnd, code, iItem, &nmitem); } /** @@ -950,23 +957,6 @@ if (lpItem->callbackMask&HDI_IMAGE) lpItem->iImage = I_IMAGECALLBACK; -} - -static BOOL -HEADER_SendClickNotify (HWND hwnd, UINT code, INT iItem) -{ - HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); - NMHEADERA nmhdr; - - nmhdr.hdr.hwndFrom = hwnd; - nmhdr.hdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID); - nmhdr.hdr.code = code; - nmhdr.iItem = iItem; - nmhdr.iButton = 0; - nmhdr.pitem = NULL; - - return (BOOL)SendMessageA (infoPtr->hwndNotify, WM_NOTIFY, - (WPARAM)nmhdr.hdr.idFrom, (LPARAM)&nmhdr); } static LRESULT @@ -1060,67 +1050,40 @@ { HEADER_INFO *infoPtr = HEADER_GetInfoPtr(hwnd); INT iItem = (INT)wParam; + INT iOrder; + INT i; TRACE("[iItem=%d]\n", iItem); if ((iItem < 0) || (iItem >= (INT)infoPtr->uNumItem)) return FALSE; - if (infoPtr->uNumItem == 1) { - TRACE("Simple delete!\n"); - HEADER_DisposeItem(&infoPtr->items[0]); - Free (infoPtr->items); - Free(infoPtr->order); - infoPtr->items = 0; - infoPtr->order = 0; - infoPtr->uNumItem = 0; - } - else { - HEADER_ITEM *oldItems = infoPtr->items; - INT i; - INT iOrder; - TRACE("Complex delete! [iItem=%d]\n", iItem); - - for (i = 0; i < infoPtr->uNumItem; i++) - TRACE("%d: order=%d, iOrder=%d, ->iOrder=%d\n", i, infoPtr->order[i], infoPtr->items[i].iOrder, infoPtr->items[infoPtr->order[i]].iOrder); - HEADER_DisposeItem(&infoPtr->items[iItem]); - iOrder = infoPtr->items[iItem].iOrder; - - infoPtr->uNumItem--; - infoPtr->items = Alloc (sizeof (HEADER_ITEM) * infoPtr->uNumItem); - /* pre delete copy */ - if (iItem > 0) { - memcpy (&infoPtr->items[0], &oldItems[0], - iItem * sizeof(HEADER_ITEM)); - } - - /* post delete copy */ - if (iItem < infoPtr->uNumItem) { - memcpy (&infoPtr->items[iItem], &oldItems[iItem+1], - (infoPtr->uNumItem - iItem) * sizeof(HEADER_ITEM)); - } - - /* Correct the orders */ - if (iOrder < infoPtr->uNumItem) - { - memmove(&infoPtr->order[iOrder], &infoPtr->order[iOrder + 1], - (infoPtr->uNumItem - iOrder) * sizeof(INT)); - for (i = 0; i < infoPtr->uNumItem; i++) - { - if (infoPtr->order[i] > iItem) - infoPtr->order[i]--; - if (i >= iOrder) - infoPtr->items[infoPtr->order[i]].iOrder = infoPtr->order[i]; - } - } - - for (i = 0; i < infoPtr->uNumItem; i++) - TRACE("%d: order=%d, iOrder=%d, ->iOrder=%d\n", i, infoPtr->order[i], infoPtr->items[i].iOrder, infoPtr->items[infoPtr->order[i]].iOrder); - Free (oldItems); - } + for (i = 0; i < infoPtr->uNumItem; i++) + TRACE("%d: order=%d, iOrder=%d, ->iOrder=%d\n", i, infoPtr->order[i], infoPtr->items[i].iOrder, infoPtr->items[infoPtr->order[i]].iOrder); + + iOrder = infoPtr->items[iItem].iOrder; + HEADER_DisposeItem(&infoPtr->items[iItem]); + + infoPtr->uNumItem--; + memmove(&infoPtr->items[iItem], &infoPtr->items[iItem + 1], + (infoPtr->uNumItem - iItem) * sizeof(HEADER_ITEM)); + memmove(&infoPtr->order[iOrder], &infoPtr->order[iOrder + 1], + (infoPtr->uNumItem - iOrder) * sizeof(INT)); + infoPtr->items = ReAlloc(infoPtr->items, sizeof(HEADER_ITEM) * infoPtr->uNumItem); + infoPtr->order = ReAlloc(infoPtr->order, sizeof(INT) * infoPtr->uNumItem); + + /* Correct the orders */ + for (i = 0; i < infoPtr->uNumItem; i++) + { + if (infoPtr->order[i] > iItem) + infoPtr->order[i]--; + if (i >= iOrder) + infoPtr->items[infoPtr->order[i]].iOrder = i; + } + for (i = 0; i < infoPtr->uNumItem; i++) + TRACE("%d: order=%d, iOrder=%d, ->iOrder=%d\n", i, infoPtr->order[i], infoPtr->items[i].iOrder, infoPtr->items[infoPtr->order[i]].iOrder); HEADER_SetItemBounds (hwnd); - InvalidateRect(hwnd, NULL, FALSE); return TRUE; @@ -1299,51 +1262,23 @@ else if (infoPtr->uNumItem < iOrder) iOrder = infoPtr->uNumItem; - if (infoPtr->uNumItem == 0) { - infoPtr->items = Alloc (sizeof (HEADER_ITEM)); - infoPtr->order = Alloc(sizeof(INT)); - infoPtr->uNumItem++; - } - else { - HEADER_ITEM *oldItems = infoPtr->items; - INT *oldOrder = infoPtr->order; - - infoPtr->uNumItem++; - infoPtr->items = Alloc (sizeof (HEADER_ITEM) * infoPtr->uNumItem); - if (nItem == 0) { - memcpy (&infoPtr->items[1], &oldItems[0], - (infoPtr->uNumItem-1) * sizeof(HEADER_ITEM)); - } - else - { - /* pre insert copy */ - if (nItem > 0) { - memcpy (&infoPtr->items[0], &oldItems[0], - nItem * sizeof(HEADER_ITEM)); - } - - /* post insert copy */ - if (nItem < infoPtr->uNumItem - 1) { - memcpy (&infoPtr->items[nItem+1], &oldItems[nItem], - (infoPtr->uNumItem - nItem - 1) * sizeof(HEADER_ITEM)); - } - } - - infoPtr->order = Alloc(sizeof(INT) * infoPtr->uNumItem); - memcpy(infoPtr->order, oldOrder, iOrder * sizeof(INT)); - infoPtr->order[iOrder] = nItem; - memcpy(&infoPtr->order[iOrder + 1], &oldOrder[iOrder], - (infoPtr->uNumItem - iOrder - 1) * sizeof(INT)); - - Free (oldItems); - Free(oldOrder); - } - + infoPtr->uNumItem++; + infoPtr->items = ReAlloc(infoPtr->items, sizeof(HEADER_ITEM) * infoPtr->uNumItem); + infoPtr->order = ReAlloc(infoPtr->order, sizeof(INT) * infoPtr->uNumItem); + + /* make space for the new item */ + memmove(&infoPtr->items[nItem + 1], &infoPtr->items[nItem], + (infoPtr->uNumItem - nItem - 1) * sizeof(HEADER_ITEM)); + memmove(&infoPtr->order[iOrder + 1], &infoPtr->order[iOrder], + (infoPtr->uNumItem - iOrder - 1) * sizeof(INT)); + + /* update the order array */ + infoPtr->order[iOrder] = nItem; for (i = 0; i < infoPtr->uNumItem; i++) { if (i != iOrder && infoPtr->order[i] >= nItem) infoPtr->order[i]++; - infoPtr->items[infoPtr->order[i]].iOrder = infoPtr->order[i]; + infoPtr->items[infoPtr->order[i]].iOrder = i; } lpItem = &infoPtr->items[nItem]; @@ -1351,6 +1286,7 @@ /* cxy, fmt and lParam are copied even if not in the HDITEM mask */ copyMask = phdi->mask | HDI_WIDTH | HDI_FORMAT | HDI_LPARAM; HEADER_StoreHDItemInHeader(lpItem, copyMask, phdi, bUnicode); + lpItem->iOrder = iOrder; /* set automatically some format bits */ if (phdi->mask & HDI_TEXT) @@ -1366,10 +1302,7 @@ if (phdi->mask & HDI_IMAGE) lpItem->fmt |= HDF_IMAGE; - lpItem->iOrder = iOrder; - HEADER_SetItemBounds (hwnd); - InvalidateRect(hwnd, NULL, FALSE); return nItem; @@ -1456,7 +1389,7 @@ TRACE("[nItem=%d]\n", nItem); HEADER_CopyHDItemForNotify(infoPtr, &hdNotify, phdi, bUnicode, &pvScratch); - if (HEADER_SendHeaderNotifyT (hwnd, HDN_ITEMCHANGINGW, nItem, phdi->mask, &hdNotify)) + if (HEADER_SendNotifyWithHDItemT(hwnd, HDN_ITEMCHANGINGW, nItem, &hdNotify)) { if (pvScratch) Free(pvScratch); return FALSE; @@ -1469,7 +1402,7 @@ if (phdi->iOrder >= 0 && phdi->iOrder < infoPtr->uNumItem) HEADER_ChangeItemOrder(infoPtr, nItem, phdi->iOrder); - HEADER_SendHeaderNotifyT (hwnd, HDN_ITEMCHANGEDW, nItem, phdi->mask, &hdNotify); + HEADER_SendNotifyWithHDItemT(hwnd, HDN_ITEMCHANGEDW, nItem, &hdNotify); HEADER_SetItemBounds (hwnd); @@ -1597,9 +1530,9 @@ HEADER_InternalHitTest (hwnd, &pt, &flags, &nItem); if ((GetWindowLongW (hwnd, GWL_STYLE) & HDS_BUTTONS) && (flags == HHT_ONHEADER)) - HEADER_SendHeaderNotifyT (hwnd, HDN_ITEMDBLCLICKW, nItem, 0, NULL); + HEADER_SendNotifyWithHDItemT(hwnd, HDN_ITEMDBLCLICKW, nItem, NULL); else if ((flags == HHT_ONDIVIDER) || (flags == HHT_ONDIVOPEN)) - HEADER_SendHeaderNotifyT (hwnd, HDN_DIVIDERDBLCLICKW, nItem, 0, NULL); + HEADER_SendNotifyWithHDItemT(hwnd, HDN_DIVIDERDBLCLICKW, nItem, NULL); return 0; } @@ -1637,12 +1570,13 @@ TRACE("Pressed item %d!\n", nItem); } else if ((flags == HHT_ONDIVIDER) || (flags == HHT_ONDIVOPEN)) { - if (!(HEADER_SendHeaderNotifyT (hwnd, HDN_BEGINTRACKW, nItem, HDI_WIDTH, NULL))) { + INT iCurrWidth = infoPtr->items[nItem].cxy; + if (!HEADER_SendNotifyWithIntFieldT(hwnd, HDN_BEGINTRACKW, nItem, HDI_WIDTH, iCurrWidth)) + { SetCapture (hwnd); infoPtr->bCaptured = TRUE; infoPtr->bTracking = TRUE; infoPtr->iMoveItem = nItem; - infoPtr->nOldWidth = infoPtr->items[nItem].cxy; infoPtr->xTrackOffset = infoPtr->items[nItem].rect.right - pt.x; if (!(dwStyle & HDS_FULLDRAG)) { @@ -1667,7 +1601,7 @@ DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE); POINT pt; UINT flags; - INT nItem, nWidth; + INT nItem; HDC hdc; pt.x = (INT)(SHORT)LOWORD(lParam); @@ -1695,9 +1629,8 @@ iNewOrder--; } - /* FIXME: the new order field should be sent, not the old one */ if (iNewOrder != -1 && - !HEADER_SendHeaderNotifyT(hwnd, HDN_ENDDRAG, infoPtr->iMoveItem, HDI_ORDER, NULL)) + !HEADER_SendNotifyWithIntFieldT(hwnd, HDN_ENDDRAG, infoPtr->iMoveItem, HDI_ORDER, iNewOrder)) { HEADER_ChangeItemOrder(infoPtr, infoPtr->iMoveItem, iNewOrder); infoPtr->bRectsValid = FALSE; @@ -1715,17 +1648,20 @@ HEADER_RefreshItem (hwnd, hdc, infoPtr->iMoveItem); ReleaseDC (hwnd, hdc); - HEADER_SendClickNotify (hwnd, HDN_ITEMCLICKA, infoPtr->iMoveItem); + HEADER_SendNotifyWithHDItemT(hwnd, HDN_ITEMCLICKW, infoPtr->iMoveItem, NULL); } TRACE("Released item %d!\n", infoPtr->iMoveItem); infoPtr->bPressed = FALSE; } else if (infoPtr->bTracking) { + INT iNewWidth = pt.x - infoPtr->items[infoPtr->iMoveItem].rect.left + infoPtr->xTrackOffset; + if (iNewWidth < 0) + iNewWidth = 0; TRACE("End tracking item %d!\n", infoPtr->iMoveItem); infoPtr->bTracking = FALSE; - HEADER_SendHeaderNotifyT (hwnd, HDN_ENDTRACKW, infoPtr->iMoveItem, HDI_WIDTH, NULL); + HEADER_SendNotifyWithIntFieldT(hwnd, HDN_ENDTRACKW, infoPtr->iMoveItem, HDI_WIDTH, iNewWidth); if (!(dwStyle & HDS_FULLDRAG)) { hdc = GetDC (hwnd); @@ -1733,20 +1669,14 @@ ReleaseDC (hwnd, hdc); } - if (HEADER_SendHeaderNotifyT(hwnd, HDN_ITEMCHANGINGW, infoPtr->iMoveItem, HDI_WIDTH, NULL)) - { - infoPtr->items[infoPtr->iMoveItem].cxy = infoPtr->nOldWidth; - } - else { - nWidth = pt.x - infoPtr->items[infoPtr->iMoveItem].rect.left + infoPtr->xTrackOffset; - if (nWidth < 0) - nWidth = 0; - infoPtr->items[infoPtr->iMoveItem].cxy = nWidth; + if (!HEADER_SendNotifyWithIntFieldT(hwnd, HDN_ITEMCHANGINGW, infoPtr->iMoveItem, HDI_WIDTH, iNewWidth)) + { + infoPtr->items[infoPtr->iMoveItem].cxy = iNewWidth; + HEADER_SendNotifyWithIntFieldT(hwnd, HDN_ITEMCHANGEDW, infoPtr->iMoveItem, HDI_WIDTH, iNewWidth); } HEADER_SetItemBounds (hwnd); InvalidateRect(hwnd, NULL, TRUE); - HEADER_SendHeaderNotifyT(hwnd, HDN_ITEMCHANGEDW, infoPtr->iMoveItem, HDI_WIDTH, NULL); } if (infoPtr->bCaptured) { @@ -1826,7 +1756,7 @@ if (infoPtr->bPressed && !infoPtr->bDragging && dwStyle&HDS_DRAGDROP && HEADER_IsDragDistance(infoPtr, &pt)) { - if (!HEADER_SendHeaderNotifyT(hwnd, HDN_BEGINDRAG, infoPtr->iMoveItem, 0, NULL)) + if (!HEADER_SendNotifyWithHDItemT(hwnd, HDN_BEGINDRAG, infoPtr->iMoveItem, NULL)) { HIMAGELIST hDragItem = (HIMAGELIST)HEADER_CreateDragImage(hwnd, infoPtr->iMoveItem); if (hDragItem != NULL) @@ -1867,14 +1797,14 @@ } else if (infoPtr->bTracking) { if (dwStyle & HDS_FULLDRAG) { - if (!HEADER_SendHeaderNotifyT (hwnd, HDN_ITEMCHANGINGW, infoPtr->iMoveItem, HDI_WIDTH, NULL)) + HEADER_ITEM *lpItem = &infoPtr->items[infoPtr->iMoveItem]; + nWidth = pt.x - lpItem->rect.left + infoPtr->xTrackOffset; + if (!HEADER_SendNotifyWithIntFieldT(hwnd, HDN_ITEMCHANGINGW, infoPtr->iMoveItem, HDI_WIDTH, nWidth)) { - HEADER_ITEM *lpItem = &infoPtr->items[infoPtr->iMoveItem]; INT nOldWidth = lpItem->rect.right - lpItem->rect.left; RECT rcClient; RECT rcScroll; - nWidth = pt.x - lpItem->rect.left + infoPtr->xTrackOffset; if (nWidth < 0) nWidth = 0; infoPtr->items[infoPtr->iMoveItem].cxy = nWidth; HEADER_SetItemBounds(hwnd); @@ -1886,20 +1816,21 @@ InvalidateRect(hwnd, &lpItem->rect, FALSE); UpdateWindow(hwnd); - HEADER_SendHeaderNotifyT(hwnd, HDN_ITEMCHANGEDW, infoPtr->iMoveItem, HDI_WIDTH, NULL); + HEADER_SendNotifyWithIntFieldT(hwnd, HDN_ITEMCHANGEDW, infoPtr->iMoveItem, HDI_WIDTH, nWidth); } } else { + INT iTrackWidth; hdc = GetDC (hwnd); HEADER_DrawTrackLine (hwnd, hdc, infoPtr->xOldTrack); infoPtr->xOldTrack = pt.x + infoPtr->xTrackOffset; if (infoPtr->xOldTrack < infoPtr->items[infoPtr->iMoveItem].rect.left) infoPtr->xOldTrack = infoPtr->items[infoPtr->iMoveItem].rect.left; - infoPtr->items[infoPtr->iMoveItem].cxy = - infoPtr->xOldTrack - infoPtr->items[infoPtr->iMoveItem].rect.left; HEADER_DrawTrackLine (hwnd, hdc, infoPtr->xOldTrack); ReleaseDC (hwnd, hdc); - HEADER_SendHeaderNotifyT (hwnd, HDN_TRACKW, infoPtr->iMoveItem, HDI_WIDTH, NULL); + iTrackWidth = infoPtr->xOldTrack - infoPtr->items[infoPtr->iMoveItem].rect.left; + /* FIXME: should stop tracking if HDN_TRACK returnes TRUE */ + HEADER_SendNotifyWithIntFieldT(hwnd, HDN_TRACKW, infoPtr->iMoveItem, HDI_WIDTH, iTrackWidth); } TRACE("Tracking item %d!\n", infoPtr->iMoveItem); Modified: trunk/reactos/dll/win32/comctl32/imagelist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/imageli…
============================================================================== --- trunk/reactos/dll/win32/comctl32/imagelist.c (original) +++ trunk/reactos/dll/win32/comctl32/imagelist.c Wed Oct 4 02:46:26 2006 @@ -2546,11 +2546,12 @@ if (!is_valid(himl)) return FALSE; - if (himl->cCurImage >= iImageCount) - return FALSE; + if (iImageCount < 0) + return FALSE; if (himl->cMaxImage > iImageCount) { himl->cCurImage = iImageCount; + /* TODO: shrink the bitmap when cMaxImage-cCurImage>cGrow ? */ return TRUE; } Modified: trunk/reactos/dll/win32/comctl32/toolbar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/toolbar…
============================================================================== --- trunk/reactos/dll/win32/comctl32/toolbar.c (original) +++ trunk/reactos/dll/win32/comctl32/toolbar.c Wed Oct 4 02:46:26 2006 @@ -250,6 +250,7 @@ static LRESULT TOOLBAR_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam); static void TOOLBAR_SetHotItemEx (TOOLBAR_INFO *infoPtr, INT nHit, DWORD dwReason); static LRESULT TOOLBAR_AutoSize(HWND hwnd); +static void TOOLBAR_CheckImageListIconSize(TOOLBAR_INFO *infoPtr); static LRESULT TOOLBAR_NotifyFormat(TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam); @@ -1090,6 +1091,9 @@ } TOOLBAR_DumpToolbar (infoPtr, __LINE__); + + /* change the imagelist icon size if we manage the list and it is necessary */ + TOOLBAR_CheckImageListIconSize(infoPtr); /* Send initial notify */ ZeroMemory (&tbcd, sizeof(NMTBCUSTOMDRAW)); @@ -2568,6 +2572,101 @@ } } +static BOOL +TOOLBAR_AddBitmapToImageList(TOOLBAR_INFO *infoPtr, HIMAGELIST himlDef, const TBITMAP_INFO *bitmap) +{ + HBITMAP hbmLoad; + INT nCountBefore = ImageList_GetImageCount(himlDef); + INT nCountAfter; + INT cxIcon, cyIcon; + INT nAdded; + INT nIndex; + + TRACE("adding hInst=%p nID=%d nButtons=%d\n", bitmap->hInst, bitmap->nID, bitmap->nButtons); + /* Add bitmaps to the default image list */ + if (bitmap->hInst == NULL) /* a handle was passed */ + { + BITMAP bmp; + HBITMAP hOldBitmapBitmap, hOldBitmapLoad; + HDC hdcImage, hdcBitmap; + + /* copy the bitmap before adding it so that the user's bitmap + * doesn't get modified. + */ + GetObjectW ((HBITMAP)bitmap->nID, sizeof(BITMAP), (LPVOID)&bmp); + + hdcImage = CreateCompatibleDC(0); + hdcBitmap = CreateCompatibleDC(0); + + /* create new bitmap */ + hbmLoad = CreateBitmap (bmp.bmWidth, bmp.bmHeight, bmp.bmPlanes, bmp.bmBitsPixel, NULL); + hOldBitmapBitmap = SelectObject(hdcBitmap, (HBITMAP)bitmap->nID); + hOldBitmapLoad = SelectObject(hdcImage, hbmLoad); + + /* Copy the user's image */ + BitBlt (hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, + hdcBitmap, 0, 0, SRCCOPY); + + SelectObject (hdcImage, hOldBitmapLoad); + SelectObject (hdcBitmap, hOldBitmapBitmap); + DeleteDC (hdcImage); + DeleteDC (hdcBitmap); + } + else + hbmLoad = CreateMappedBitmap(bitmap->hInst, bitmap->nID, 0, NULL, 0); + + /* enlarge the bitmap if needed */ + ImageList_GetIconSize(himlDef, &cxIcon, &cyIcon); + COMCTL32_EnsureBitmapSize(&hbmLoad, cxIcon*(INT)bitmap->nButtons, cyIcon, comctl32_color.clrBtnFace); + + nIndex = ImageList_AddMasked(himlDef, hbmLoad, comctl32_color.clrBtnFace); + DeleteObject(hbmLoad); + if (nIndex == -1) + return FALSE; + + nCountAfter = ImageList_GetImageCount(himlDef); + nAdded = nCountAfter - nCountBefore; + if (bitmap->nButtons == 0) /* wParam == 0 is special and means add only one image */ + { + ImageList_SetImageCount(himlDef, nCountBefore + 1); + } else if (nAdded > (INT)bitmap->nButtons) { + TRACE("Added more images than wParam: Previous image number %i added %i while wParam %i. Images in list %i\n", + nCountBefore, nAdded, bitmap->nButtons, nCountAfter); + } + + infoPtr->nNumBitmaps += nAdded; + return TRUE; +} + +static void +TOOLBAR_CheckImageListIconSize(TOOLBAR_INFO *infoPtr) +{ + HIMAGELIST himlDef; + HIMAGELIST himlNew; + INT cx, cy; + INT i; + + himlDef = GETDEFIMAGELIST(infoPtr, 0); + if (himlDef == NULL || himlDef != infoPtr->himlInt) + return; + if (!ImageList_GetIconSize(himlDef, &cx, &cy)) + return; + if (cx == infoPtr->nBitmapWidth && cy == infoPtr->nBitmapHeight) + return; + + TRACE("Update icon size: %dx%d -> %dx%d\n", + cx, cy, infoPtr->nBitmapWidth, infoPtr->nBitmapHeight); + + himlNew = ImageList_Create(infoPtr->nBitmapWidth, infoPtr->nBitmapHeight, + ILC_COLORDDB|ILC_MASK, 8, 2); + for (i = 0; i < infoPtr->nNumBitmapInfos; i++) + TOOLBAR_AddBitmapToImageList(infoPtr, himlNew, &infoPtr->bitmaps[i]); + TOOLBAR_InsertImageList(&infoPtr->himlDef, &infoPtr->cimlDef, himlNew, 0); + infoPtr->himlInt = himlNew; + + infoPtr->nNumBitmaps -= ImageList_GetImageCount(himlDef); + ImageList_Destroy(himlDef); +} /*********************************************************************** * TOOLBAR_AddBitmap: Add the bitmaps to the default image list. @@ -2578,8 +2677,8 @@ { TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); LPTBADDBITMAP lpAddBmp = (LPTBADDBITMAP)lParam; - INT nIndex = 0, nButtons, nCount; - HBITMAP hbmLoad; + TBITMAP_INFO info; + INT iSumButtons, i; HIMAGELIST himlDef; TRACE("hwnd=%p wParam=%x lParam=%lx\n", hwnd, wParam, lParam); @@ -2588,16 +2687,38 @@ if (lpAddBmp->hInst == HINST_COMMCTRL) { - if ((lpAddBmp->nID & ~1) == IDB_STD_SMALL_COLOR) - nButtons = 15; - else if ((lpAddBmp->nID & ~1) == IDB_VIEW_SMALL_COLOR) - nButtons = 13; - else if ((lpAddBmp->nID & ~1) == IDB_HIST_SMALL_COLOR) - nButtons = 5; - else - return -1; - - TRACE ("adding %d internal bitmaps!\n", nButtons); + info.hInst = COMCTL32_hModule; + switch (lpAddBmp->nID) + { + case IDB_STD_SMALL_COLOR: + info.nButtons = 15; + info.nID = IDB_STD_SMALL; + break; + case IDB_STD_LARGE_COLOR: + info.nButtons = 15; + info.nID = IDB_STD_LARGE; + break; + case IDB_VIEW_SMALL_COLOR: + info.nButtons = 12; + info.nID = IDB_VIEW_SMALL; + break; + case IDB_VIEW_LARGE_COLOR: + info.nButtons = 12; + info.nID = IDB_VIEW_LARGE; + break; + case IDB_HIST_SMALL_COLOR: + info.nButtons = 5; + info.nID = IDB_HIST_SMALL; + break; + case IDB_HIST_LARGE_COLOR: + info.nButtons = 5; + info.nID = IDB_HIST_LARGE; + break; + default: + return -1; + } + + TRACE ("adding %d internal bitmaps!\n", info.nButtons); /* Windows resize all the buttons to the size of a newly added standard image */ if (lpAddBmp->nID & 1) @@ -2624,11 +2745,20 @@ } else { - nButtons = (INT)wParam; - if (nButtons <= 0) - return -1; - - TRACE ("adding %d bitmaps!\n", nButtons); + info.nButtons = (INT)wParam; + info.hInst = lpAddBmp->hInst; + info.nID = lpAddBmp->nID; + TRACE("adding %d bitmaps!\n", info.nButtons); + } + + /* check if the bitmap is already loaded and compute iSumButtons */ + iSumButtons = 0; + for (i = 0; i < infoPtr->nNumBitmapInfos; i++) + { + if (infoPtr->bitmaps[i].hInst == info.hInst && + infoPtr->bitmaps[i].nID == info.nID) + return iSumButtons; + iSumButtons += infoPtr->bitmaps[i].nButtons; } if (!infoPtr->cimlDef) { @@ -2636,7 +2766,7 @@ TRACE ("creating default image list!\n"); himlDef = ImageList_Create (infoPtr->nBitmapWidth, infoPtr->nBitmapHeight, - ILC_COLORDDB | ILC_MASK, nButtons, 2); + ILC_COLORDDB | ILC_MASK, info.nButtons, 2); TOOLBAR_InsertImageList(&infoPtr->himlDef, &infoPtr->cimlDef, himlDef, 0); infoPtr->himlInt = himlDef; } @@ -2649,145 +2779,17 @@ return -1; } - nCount = ImageList_GetImageCount(himlDef); - - /* Add bitmaps to the default image list */ - if (lpAddBmp->hInst == NULL) - { - BITMAP bmp; - HBITMAP hOldBitmapBitmap, hOldBitmapLoad; - HDC hdcImage, hdcBitmap; - - /* copy the bitmap before adding it so that the user's bitmap - * doesn't get modified. - */ - GetObjectW ((HBITMAP)lpAddBmp->nID, sizeof(BITMAP), (LPVOID)&bmp); - - hdcImage = CreateCompatibleDC(0); - hdcBitmap = CreateCompatibleDC(0); - - /* create new bitmap */ - hbmLoad = CreateBitmap (bmp.bmWidth, bmp.bmHeight, bmp.bmPlanes, bmp.bmBitsPixel, NULL); - hOldBitmapBitmap = SelectObject(hdcBitmap, (HBITMAP)lpAddBmp->nID); - hOldBitmapLoad = SelectObject(hdcImage, hbmLoad); - - /* Copy the user's image */ - BitBlt (hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, - hdcBitmap, 0, 0, SRCCOPY); - - SelectObject (hdcImage, hOldBitmapLoad); - SelectObject (hdcBitmap, hOldBitmapBitmap); - DeleteDC (hdcImage); - DeleteDC (hdcBitmap); - - nIndex = ImageList_AddMasked (himlDef, hbmLoad, comctl32_color.clrBtnFace); - DeleteObject (hbmLoad); - } - else if (lpAddBmp->hInst == HINST_COMMCTRL) - { - /* Add system bitmaps */ - switch (lpAddBmp->nID) - { - case IDB_STD_SMALL_COLOR: - hbmLoad = CreateMappedBitmap (COMCTL32_hModule, - IDB_STD_SMALL, 0, NULL, 0); - nIndex = ImageList_AddMasked (himlDef, - hbmLoad, comctl32_color.clrBtnFace); - DeleteObject (hbmLoad); - break; - - case IDB_STD_LARGE_COLOR: - hbmLoad = CreateMappedBitmap (COMCTL32_hModule, - IDB_STD_LARGE, 0, NULL, 0); - nIndex = ImageList_AddMasked (himlDef, - hbmLoad, comctl32_color.clrBtnFace); - DeleteObject (hbmLoad); - break; - - case IDB_VIEW_SMALL_COLOR: - hbmLoad = CreateMappedBitmap (COMCTL32_hModule, - IDB_VIEW_SMALL, 0, NULL, 0); - nIndex = ImageList_AddMasked (himlDef, - hbmLoad, comctl32_color.clrBtnFace); - DeleteObject (hbmLoad); - break; - - case IDB_VIEW_LARGE_COLOR: - hbmLoad = CreateMappedBitmap (COMCTL32_hModule, - IDB_VIEW_LARGE, 0, NULL, 0); - nIndex = ImageList_AddMasked (himlDef, - hbmLoad, comctl32_color.clrBtnFace); - DeleteObject (hbmLoad); - break; - - case IDB_HIST_SMALL_COLOR: - hbmLoad = CreateMappedBitmap (COMCTL32_hModule, - IDB_HIST_SMALL, 0, NULL, 0); - nIndex = ImageList_AddMasked (himlDef, - hbmLoad, comctl32_color.clrBtnFace); - DeleteObject (hbmLoad); - break; - - case IDB_HIST_LARGE_COLOR: - hbmLoad = CreateMappedBitmap (COMCTL32_hModule, - IDB_HIST_LARGE, 0, NULL, 0); - nIndex = ImageList_AddMasked (himlDef, - hbmLoad, comctl32_color.clrBtnFace); - DeleteObject (hbmLoad); - break; - - default: - nIndex = ImageList_GetImageCount (himlDef); - ERR ("invalid imagelist!\n"); - break; - } - } - else - { - hbmLoad = CreateMappedBitmap(lpAddBmp->hInst, lpAddBmp->nID, 0, NULL, 0); - nIndex = ImageList_AddMasked (himlDef, hbmLoad, comctl32_color.clrBtnFace); - DeleteObject (hbmLoad); - } + if (!TOOLBAR_AddBitmapToImageList(infoPtr, himlDef, &info)) + return -1; TRACE("Number of bitmap infos: %d\n", infoPtr->nNumBitmapInfos); - - if (infoPtr->nNumBitmapInfos == 0) - { - infoPtr->bitmaps = Alloc(sizeof(TBITMAP_INFO)); - } - else - { - TBITMAP_INFO *oldBitmaps = infoPtr->bitmaps; - infoPtr->bitmaps = Alloc((infoPtr->nNumBitmapInfos + 1) * sizeof(TBITMAP_INFO)); - memcpy(&infoPtr->bitmaps[0], &oldBitmaps[0], infoPtr->nNumBitmapInfos * sizeof(TBITMAP_INFO)); - } - - infoPtr->bitmaps[infoPtr->nNumBitmapInfos].nButtons = nButtons; - infoPtr->bitmaps[infoPtr->nNumBitmapInfos].hInst = lpAddBmp->hInst; - infoPtr->bitmaps[infoPtr->nNumBitmapInfos].nID = lpAddBmp->nID; - + infoPtr->bitmaps = ReAlloc(infoPtr->bitmaps, (infoPtr->nNumBitmapInfos + 1) * sizeof(TBITMAP_INFO)); + infoPtr->bitmaps[infoPtr->nNumBitmapInfos] = info; infoPtr->nNumBitmapInfos++; TRACE("Number of bitmap infos: %d\n", infoPtr->nNumBitmapInfos); - if (nIndex != -1) - { - INT imagecount = ImageList_GetImageCount(himlDef); - - if (infoPtr->nNumBitmaps + nButtons != imagecount) - { - WARN("Desired images do not match received images : Previous image number %i Previous images in list %i added %i expecting total %i, Images in list %i\n", - infoPtr->nNumBitmaps, nCount, imagecount - nCount, - infoPtr->nNumBitmaps+nButtons,imagecount); - - infoPtr->nNumBitmaps = imagecount; - } - else - infoPtr->nNumBitmaps += nButtons; - } - InvalidateRect(hwnd, NULL, TRUE); - - return nIndex; + return iSumButtons; } @@ -2929,64 +2931,57 @@ static LRESULT -TOOLBAR_AddStringA (HWND hwnd, WPARAM wParam, LPARAM lParam) -{ - TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); - INT nIndex; +TOOLBAR_AddStringW (HWND hwnd, WPARAM wParam, LPARAM lParam) +{ +#define MAX_RESOURCE_STRING_LENGTH 512 + TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); + INT nIndex = infoPtr->nNumStrings; if ((wParam) && (HIWORD(lParam) == 0)) { - char szString[256]; + WCHAR szString[MAX_RESOURCE_STRING_LENGTH]; + WCHAR delimiter; + WCHAR *next_delim; + WCHAR *p; INT len; TRACE("adding string from resource!\n"); - len = LoadStringA ((HINSTANCE)wParam, (UINT)lParam, szString, sizeof(szString)); - - TRACE("len=%d \"%s\"\n", len, szString); - nIndex = infoPtr->nNumStrings; - if (infoPtr->nNumStrings == 0) { - infoPtr->strings = - Alloc (sizeof(LPWSTR)); - } - else { - LPWSTR *oldStrings = infoPtr->strings; - infoPtr->strings = - Alloc (sizeof(LPWSTR) * (infoPtr->nNumStrings + 1)); - memcpy (&infoPtr->strings[0], &oldStrings[0], - sizeof(LPWSTR) * infoPtr->nNumStrings); - Free (oldStrings); - } - - /*Alloc zeros out the allocated memory*/ - Str_SetPtrAtoW (&infoPtr->strings[infoPtr->nNumStrings], szString ); - infoPtr->nNumStrings++; + LoadStringW ((HINSTANCE)wParam, (UINT)lParam, + szString, MAX_RESOURCE_STRING_LENGTH); + len = lstrlenW(szString); + + TRACE("len=%d %s\n", len, debugstr_w(szString)); + if (len == 0 || len == 1) + return nIndex; + + TRACE("Delimiter: 0x%x\n", *szString); + delimiter = *szString; + p = szString + 1; + if (szString[len-1] == delimiter) + szString[len-1] = 0; + + while ((next_delim = strchrW(p, delimiter)) != NULL) { + *next_delim = 0; + + infoPtr->strings = ReAlloc(infoPtr->strings, sizeof(LPWSTR)*(infoPtr->nNumStrings+1)); + Str_SetPtrW(&infoPtr->strings[infoPtr->nNumStrings], p); + infoPtr->nNumStrings++; + + p = next_delim + 1; + } } else { - LPSTR p = (LPSTR)lParam; + LPWSTR p = (LPWSTR)lParam; INT len; if (p == NULL) return -1; TRACE("adding string(s) from array!\n"); - - nIndex = infoPtr->nNumStrings; while (*p) { - len = strlen (p); - TRACE("len=%d \"%s\"\n", len, p); - - if (infoPtr->nNumStrings == 0) { - infoPtr->strings = - Alloc (sizeof(LPWSTR)); - } - else { - LPWSTR *oldStrings = infoPtr->strings; - infoPtr->strings = - Alloc (sizeof(LPWSTR) * (infoPtr->nNumStrings + 1)); - memcpy (&infoPtr->strings[0], &oldStrings[0], - sizeof(LPWSTR) * infoPtr->nNumStrings); - Free (oldStrings); - } - - Str_SetPtrAtoW (&infoPtr->strings[infoPtr->nNumStrings], p ); + len = strlenW (p); + + TRACE("len=%d %s\n", len, debugstr_w(p)); + infoPtr->strings = ReAlloc(infoPtr->strings, sizeof(LPWSTR)*(infoPtr->nNumStrings+1)); + Str_SetPtrW (&infoPtr->strings[infoPtr->nNumStrings], p); infoPtr->nNumStrings++; p += (len+1); @@ -2998,109 +2993,31 @@ static LRESULT -TOOLBAR_AddStringW (HWND hwnd, WPARAM wParam, LPARAM lParam) -{ -#define MAX_RESOURCE_STRING_LENGTH 512 - TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); +TOOLBAR_AddStringA (HWND hwnd, WPARAM wParam, LPARAM lParam) +{ + TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); + LPSTR p; INT nIndex; - - if ((wParam) && (HIWORD(lParam) == 0)) { - WCHAR szString[MAX_RESOURCE_STRING_LENGTH]; - INT len; - TRACE("adding string from resource!\n"); - - len = LoadStringW ((HINSTANCE)wParam, (UINT)lParam, - szString, MAX_RESOURCE_STRING_LENGTH); - - TRACE("len=%d %s\n", len, debugstr_w(szString)); - TRACE("First char: 0x%x\n", *szString); - if (szString[0] == L'|') - { - PWSTR p = szString + 1; - - nIndex = infoPtr->nNumStrings; - while (*p != L'|' && *p != L'\0') { - PWSTR np; - - if (infoPtr->nNumStrings == 0) { - infoPtr->strings = Alloc (sizeof(LPWSTR)); - } - else - { - LPWSTR *oldStrings = infoPtr->strings; - infoPtr->strings = Alloc(sizeof(LPWSTR) * (infoPtr->nNumStrings + 1)); - memcpy(&infoPtr->strings[0], &oldStrings[0], - sizeof(LPWSTR) * infoPtr->nNumStrings); - Free(oldStrings); - } - - np=strchrW (p, '|'); - if (np!=NULL) { - len = np - p; - np++; - } else { - len = strlenW(p); - np = p + len; - } - TRACE("len=%d %s\n", len, debugstr_w(p)); - infoPtr->strings[infoPtr->nNumStrings] = - Alloc (sizeof(WCHAR)*(len+1)); - lstrcpynW (infoPtr->strings[infoPtr->nNumStrings], p, len+1); - infoPtr->nNumStrings++; - - p = np; - } - } - else - { - nIndex = infoPtr->nNumStrings; - if (infoPtr->nNumStrings == 0) { - infoPtr->strings = - Alloc (sizeof(LPWSTR)); - } - else { - LPWSTR *oldStrings = infoPtr->strings; - infoPtr->strings = - Alloc (sizeof(LPWSTR) * (infoPtr->nNumStrings + 1)); - memcpy (&infoPtr->strings[0], &oldStrings[0], - sizeof(LPWSTR) * infoPtr->nNumStrings); - Free (oldStrings); - } - - Str_SetPtrW (&infoPtr->strings[infoPtr->nNumStrings], szString); - infoPtr->nNumStrings++; - } - } - else { - LPWSTR p = (LPWSTR)lParam; - INT len; - - if (p == NULL) - return -1; - TRACE("adding string(s) from array!\n"); - nIndex = infoPtr->nNumStrings; - while (*p) { - len = strlenW (p); - - TRACE("len=%d %s\n", len, debugstr_w(p)); - if (infoPtr->nNumStrings == 0) { - infoPtr->strings = - Alloc (sizeof(LPWSTR)); - } - else { - LPWSTR *oldStrings = infoPtr->strings; - infoPtr->strings = - Alloc (sizeof(LPWSTR) * (infoPtr->nNumStrings + 1)); - memcpy (&infoPtr->strings[0], &oldStrings[0], - sizeof(LPWSTR) * infoPtr->nNumStrings); - Free (oldStrings); - } - - Str_SetPtrW (&infoPtr->strings[infoPtr->nNumStrings], p); - infoPtr->nNumStrings++; - - p += (len+1); - } + INT len; + + if ((wParam) && (HIWORD(lParam) == 0)) /* load from resources */ + return TOOLBAR_AddStringW(hwnd, wParam, lParam); + + p = (LPSTR)lParam; + if (p == NULL) + return -1; + + TRACE("adding string(s) from array!\n"); + nIndex = infoPtr->nNumStrings; + while (*p) { + len = strlen (p); + TRACE("len=%d \"%s\"\n", len, p); + + infoPtr->strings = ReAlloc(infoPtr->strings, sizeof(LPWSTR)*(infoPtr->nNumStrings+1)); + Str_SetPtrAtoW(&infoPtr->strings[infoPtr->nNumStrings], p); + infoPtr->nNumStrings++; + + p += (len+1); } return nIndex; @@ -3301,7 +3218,7 @@ return FALSE; ret = DialogBoxIndirectParamW ((HINSTANCE)GetWindowLongPtrW(hwnd, GWLP_HINSTANCE), - (LPDLGTEMPLATEW)template, + (LPCDLGTEMPLATEW)template, hwnd, TOOLBAR_CustomizeDialogProc, (LPARAM)&custInfo); @@ -4746,6 +4663,7 @@ infoPtr->nBitmapHeight); } + InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); return TRUE; } @@ -5672,6 +5590,7 @@ /* delete temporary buffer for tooltip text */ Free (infoPtr->pszTooltipText); + Free (infoPtr->bitmaps); /* bitmaps list */ /* delete button data */ if (infoPtr->buttons)
18 years, 2 months
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
36
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
Results per page:
10
25
50
100
200