Author: tthompson
Date: Thu May 11 01:06:40 2017
New Revision: 74520
URL: http://svn.reactos.org/svn/reactos?rev=74520&view=rev
Log:
[CMAKE] - configure.cmd - Merge latest changes from trunk (support for Visual Studio 15). Add even more foolproofing:
-Ensure the source path doesn't contain any spaces.
-Issue a warning if passed an invalid switch.
-Don't announce completion if there were errors.
-Make end message specific for VSSolution.
-Replace redundant exit commands with quit label, as suggested by HBelusca.
Modified:
branches/GSoC_2016/NTFS/configure.cmd
Modified: branches/GSoC_2016/NTFS/configure.cmd
URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/configure.cmd?re…
==============================================================================
--- branches/GSoC_2016/NTFS/configure.cmd [iso-8859-1] (original)
+++ branches/GSoC_2016/NTFS/configure.cmd [iso-8859-1] Thu May 11 01:06:40 2017
@@ -15,8 +15,7 @@
echo Syntax: path\to\source\configure.cmd [script-options] [Cmake-options]
echo Available script-options: Codeblocks, Eclipse, Makefiles, clang, VSSolution, RTC
echo Cmake-options: -DVARIABLE:TYPE=VALUE
- endlocal
- exit /b
+ goto quit
)
REM Special case %1 = arm_hosttools %2 = vcvarsall.bat %3 = %CMAKE_GENERATOR%
@@ -33,6 +32,16 @@
REM Get the source root directory
set REACTOS_SOURCE_DIR=%~dp0
+
+REM Ensure there's no spaces in the source path
+echo %REACTOS_SOURCE_DIR%| find " " > NUL
+if %ERRORLEVEL% == 0 (
+ echo. && echo Your source path contains at least one space.
+ echo This will cause problems with building.
+ echo Please rename your folders so there are no spaces in the source path,
+ echo or move your source to a different folder.
+ goto quit
+)
REM Set default generator
set CMAKE_GENERATOR="Ninja"
@@ -58,10 +67,10 @@
cl 2>&1 | find "17.00." > NUL && set VS_VERSION=11
cl 2>&1 | find "18.00." > NUL && set VS_VERSION=12
cl 2>&1 | find "19.00." > NUL && set VS_VERSION=14
+ cl 2>&1 | find "19.10." > NUL && set VS_VERSION=15
if not defined VS_VERSION (
echo Error: Visual Studio version too old or version detection failed.
- endlocal
- exit /b
+ goto quit
)
set BUILD_ENVIRONMENT=VS
set VS_SOLUTION=0
@@ -69,15 +78,13 @@
echo Detected Visual Studio Environment !BUILD_ENVIRONMENT!!VS_VERSION!-!ARCH!
) else (
echo Error: Unable to detect build environment. Configure script failure.
- endlocal
- exit /b
+ goto quit
)
REM Checkpoint
if not defined ARCH (
echo Unknown build architecture
- endlocal
- exit /b
+ goto quit
)
set NEW_STYLE_BUILD=1
@@ -98,11 +105,12 @@
) else if /I "%1" == "VSSolution" (
echo. && echo Error: Creation of VS Solution files is not supported in a MinGW environment.
echo Please run this command in a [Developer] Command Prompt for Visual Studio.
- endlocal
- exit /b
+ goto quit
) else if /I "%1" == "RTC" (
echo. && echo Warning: RTC switch is ignored outside of a Visual Studio environment. && echo.
- ) else (
+ ) else if /I "%1" NEQ "" (
+ echo. && echo Warning: Unrecognized switch "%1" && echo.
+ ) else (
goto continue
)
) else (
@@ -153,11 +161,22 @@
) else (
set CMAKE_GENERATOR="Visual Studio 14"
)
+ ) else if "!VS_VERSION!" == "15" (
+ if "!ARCH!" == "amd64" (
+ set CMAKE_GENERATOR="Visual Studio 15 Win64"
+ ) else if "!ARCH!" == "arm" (
+ set CMAKE_GENERATOR="Visual Studio 15 ARM"
+ set CMAKE_GENERATOR_HOST="Visual Studio 15"
+ ) else (
+ set CMAKE_GENERATOR="Visual Studio 15"
+ )
)
) else if /I "%1" == "RTC" (
echo Runtime checks enabled
set VS_RUNTIME_CHECKS=1
- ) else (
+ ) else if /I "%1" NEQ "" (
+ echo. && echo Warning: Unrecognized switch "%1" && echo.
+ ) else (
goto continue
)
)
@@ -195,15 +214,13 @@
echo. && echo Error: This directory has already been configured for ninja.
echo An output folder configured for ninja can't be reconfigured for VSSolution.
echo Use an empty folder or delete the contents of this folder, then try again.
- endlocal
- exit /b
+ goto quit
)
) else if exist REACTOS.sln (
echo. && echo Error: This directory has already been configured for Visual Studio.
echo An output folder configured for VSSolution can't be reconfigured for ninja.
echo Use an empty folder or delete the contents of this folder, then try again. && echo.
- endlocal
- exit /b
+ goto quit
)
if "%NEW_STYLE_BUILD%"=="0" (
@@ -261,15 +278,28 @@
cd..
)
+if %ERRORLEVEL% NEQ 0 (
+ goto quit
+)
+
if "%CD_SAME_AS_SOURCE%" == "1" (
- echo Configure script complete^^! Execute appropriate build commands ^(ex: ninja, make, nmake, etc...^) from %REACTOS_OUTPUT_PATH%.
+ set ENDV= from %REACTOS_OUTPUT_PATH%
+)
+
+if "%VS_SOLUTION%" == "1" (
+ set ENDV= You can now open REACTOS.sln%ENDV%.
) else (
- echo Configure script complete^^! Execute appropriate build commands ^(ex: ninja, make, nmake, etc...^).
-)
+ set ENDV= Execute appropriate build commands ^(ex: ninja, make, nmake, etc...^)%ENDV%
+ )
+)
+
+echo. && echo Configure script complete^^!%ENDV%
+
+goto quit
+
+:cmake_notfound
+echo Unable to find cmake, if it is installed, check your PATH variable.
+
+:quit
endlocal
exit /b
-
-:cmake_notfound
-echo Unable to find cmake, if it is installed, check your PATH variable.
-endlocal
-exit /b
Author: hbelusca
Date: Tue May 9 22:09:06 2017
New Revision: 74516
URL: http://svn.reactos.org/svn/reactos?rev=74516&view=rev
Log:
[USETUP]: Fix the primary/extended partitions creation checks introduced in r63392 : indeed this is if there are *already* 4 (primary) partitions in the table that we cannot create new primary/extended partitions.
Otherwise with the old (broken) checks, we allowed creating more than 4 partitions, and then we overflowed over memory and corrupted the partition list structures.
Modified:
trunk/reactos/base/setup/usetup/partlist.c
Modified: trunk/reactos/base/setup/usetup/partlist.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/partlist…
==============================================================================
--- trunk/reactos/base/setup/usetup/partlist.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/partlist.c [iso-8859-1] Tue May 9 22:09:06 2017
@@ -3550,8 +3550,8 @@
if (PartEntry->IsPartitioned == TRUE)
return ERROR_NEW_PARTITION;
- /* Fail if there are more than 4 partitions in the list */
- if (GetPrimaryPartitionCount(DiskEntry) > 4)
+ /* Fail if there are already 4 primary partitions in the list */
+ if (GetPrimaryPartitionCount(DiskEntry) >= 4)
return ERROR_PARTITION_TABLE_FULL;
return ERROR_SUCCESS;
@@ -3572,8 +3572,8 @@
if (PartEntry->IsPartitioned == TRUE)
return ERROR_NEW_PARTITION;
- /* Fail if there are more than 4 partitions in the list */
- if (GetPrimaryPartitionCount(DiskEntry) > 4)
+ /* Fail if there are already 4 primary partitions in the list */
+ if (GetPrimaryPartitionCount(DiskEntry) >= 4)
return ERROR_PARTITION_TABLE_FULL;
/* Fail if there is another extended partition in the list */
Author: hbelusca
Date: Tue May 9 19:33:46 2017
New Revision: 74515
URL: http://svn.reactos.org/svn/reactos?rev=74515&view=rev
Log:
[FREELDR]: Report the correct number of BIOS (hard) disk drives detected, that is, without any possible extra boot drive that went enumerated afterwards.
This fixes the list of disks enumerated in HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\MultifunctionAdapter\0\DiskController\0\DiskPeripheral\
and we now behave in this regards similarly to Windows 2003 & co.
I thank Lesan Ilie for reporting & testing, and Serge Gautherie and Peter Hater for reviewing.
This fixes a bug introduced in commit r59079.
CORE-13131
Modified:
trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/hwdisk.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] Tue May 9 19:33:46 2017
@@ -35,6 +35,8 @@
#define LATCH (CLOCK_TICK_RATE / HZ)
static unsigned int delay_count = 1;
+
+/* Used for BIOS disks pre-enumeration performed when detecting the boot devices in InitializeBootDevices() */
extern UCHAR PcBiosDiskCount;
/* This function is slightly different in its PC and XBOX versions */
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwdisk.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwdisk.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwdisk.c [iso-8859-1] Tue May 9 19:33:46 2017
@@ -44,6 +44,7 @@
static CHAR Hex[] = "0123456789abcdef";
+/* Data cache for BIOS disks pre-enumeration */
UCHAR PcBiosDiskCount = 0;
static CHAR PcDiskIdentifier[32][20];
@@ -323,8 +324,8 @@
}
if (!Changed)
{
- TRACE("BIOS reports success for disk %d but data didn't change\n",
- (int)DiskCount);
+ TRACE("BIOS reports success for disk %d (0x%02X) but data didn't change\n",
+ (int)DiskCount, DriveNumber);
break;
}
@@ -340,6 +341,8 @@
memset(DiskReadBuffer, 0xcd, DiskReadBufferSize);
}
DiskReportError(TRUE);
+
+ PcBiosDiskCount = DiskCount;
TRACE("BIOS reports %d harddisk%s\n",
(int)DiskCount, (DiskCount == 1) ? "" : "s");
@@ -384,12 +387,9 @@
reactos_disk_count++;
FsRegisterDevice(BootPath, &DiskVtbl);
- DiskCount++;
- }
-
- PcBiosDiskCount = DiskCount;
- TRACE("BIOS reports %d harddisk%s\n",
- (int)DiskCount, (DiskCount == 1) ? "": "s");
+ DiskCount++; // This is not accounted for in the number of pre-enumerated BIOS drives!
+ TRACE("Additional boot drive detected: 0x%02X\n", (int)FrldrBootDrive);
+ }
return (DiskCount != 0);
}