Author: pschweitzer
Date: Tue Feb 7 17:40:15 2012
New Revision: 55485
URL: http://svn.reactos.org/svn/reactos?rev=55485&view=rev
Log:
[NTOSKRNL]
Fix a FIXME in IopCreateArcNames.
This allows ntoskrnl to find where it boots from and where it is when performing remote boot.
Now ReactOS should boot a bit farther using PXE :-).
Modified:
trunk/reactos/ntoskrnl/io/iomgr/arcname.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/arcname.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/arcname.…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/arcname.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/arcname.c [iso-8859-1] Tue Feb 7 17:40:15 2012
@@ -18,6 +18,7 @@
UNICODE_STRING IoArcHalDeviceName, IoArcBootDeviceName;
PCHAR IoLoaderArcBootDeviceName;
+extern BOOLEAN IoRemoteBootClient;
/* FUNCTIONS *****************************************************************/
@@ -40,13 +41,14 @@
NTAPI
IopCreateArcNames(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
- PARC_DISK_INFORMATION ArcDiskInfo = LoaderBlock->ArcDiskInformation;
- CHAR Buffer[128];
- ANSI_STRING ArcSystemString, ArcString;
- BOOLEAN SingleDisk;
SIZE_T Length;
NTSTATUS Status;
+ CHAR Buffer[128];
+ BOOLEAN SingleDisk;
BOOLEAN FoundBoot = FALSE;
+ UNICODE_STRING SystemDevice, LoaderPathNameW, BootDeviceName;
+ PARC_DISK_INFORMATION ArcDiskInfo = LoaderBlock->ArcDiskInformation;
+ ANSI_STRING ArcSystemString, ArcString, LanmanRedirector, LoaderPathNameA;
/* Check if we only have one disk on the machine */
SingleDisk = ArcDiskInfo->DiskSignatureListHead.Flink->Flink ==
@@ -85,7 +87,53 @@
/* Build the boot strings */
RtlInitAnsiString(&ArcSystemString, LoaderBlock->ArcHalDeviceName);
- /* FIXME: Handle IoRemoteBootClient here and create appropriate symbolic link */
+ /* If we are doing remote booting */
+ if (IoRemoteBootClient)
+ {
+ /* Yes, we have found boot device */
+ FoundBoot = TRUE;
+
+ /* Get NT device name */
+ RtlInitAnsiString(&LanmanRedirector, "\\Device\\LanmanRedirector");
+ Status = RtlAnsiStringToUnicodeString(&SystemDevice, &LanmanRedirector, TRUE);
+ if (!NT_SUCCESS(Status))
+ {
+ return Status;
+ }
+
+ /* Get ARC booting device name (in net(0) something) */
+ sprintf(Buffer, "\\ArcName\\%s", LoaderBlock->ArcBootDeviceName);
+ RtlInitAnsiString(&ArcString, Buffer);
+ Status = RtlAnsiStringToUnicodeString(&BootDeviceName, &ArcString, TRUE);
+ if (NT_SUCCESS(Status))
+ {
+ /* Map ARC to NT name */
+ IoCreateSymbolicLink(&BootDeviceName, &SystemDevice);
+ RtlFreeUnicodeString(&BootDeviceName);
+
+ /* Now, get loader path name */
+ RtlInitAnsiString(&LoaderPathNameA, LoaderBlock->NtHalPathName);
+ Status = RtlAnsiStringToUnicodeString(&LoaderPathNameW, &LoaderPathNameA, TRUE);
+ if (!NT_SUCCESS(Status))
+ {
+ RtlFreeUnicodeString(&SystemDevice);
+ return Status;
+ }
+
+ /* And set it has system partition */
+ IopStoreSystemPartitionInformation(&SystemDevice, &LoaderPathNameW);
+ }
+
+ RtlFreeUnicodeString(&SystemDevice);
+
+ /* Don't quit here, even if everything went fine!
+ * We need IopCreateArcNamesDisk to properly map
+ * devices with symlinks.
+ * It will return success if the mapping process went fine
+ * even if it didn't find boot device.
+ * It won't reset boot device finding status as well.
+ */
+ }
/* Loop every disk and try to find boot disk */
Status = IopCreateArcNamesDisk(LoaderBlock, SingleDisk, &FoundBoot);
@@ -391,7 +439,7 @@
ANSI_STRING ArcBootString, ArcSystemString, DeviceStringA, ArcNameStringA, HalPathStringA;
/* Initialise device number */
- DeviceNumber.DeviceNumber = 0xFFFFFFFF;
+ DeviceNumber.DeviceNumber = UINT_MAX;
/* Get all the disks present in the system */
DiskCount = IoGetConfigurationInformation()->DiskCount;
@@ -487,7 +535,7 @@
if (NotEnabledPresent && *lSymbolicLinkList == UNICODE_NULL)
{
/* No enabled disk worked, reset field */
- if (DeviceNumber.DeviceNumber == 0xFFFFFFFF)
+ if (DeviceNumber.DeviceNumber == UINT_MAX)
{
DeviceNumber.DeviceNumber = 0;
}
@@ -521,7 +569,7 @@
RtlFreeUnicodeString(&DeviceStringW);
/* This is a security measure, to ensure DiskNumber will be used */
- DeviceNumber.DeviceNumber = 0xFFFFFFFF;
+ DeviceNumber.DeviceNumber = UINT_MAX;
}
/* Something failed somewhere earlier, just skip the disk */
@@ -657,7 +705,7 @@
(DriveLayout->PartitionStyle == PARTITION_STYLE_MBR))
{
/* Create device name */
- sprintf(Buffer, "\\Device\\Harddisk%lu\\Partition0", (DeviceNumber.DeviceNumber != 0xFFFFFFFF) ? DeviceNumber.DeviceNumber : DiskNumber);
+ sprintf(Buffer, "\\Device\\Harddisk%lu\\Partition0", (DeviceNumber.DeviceNumber != UINT_MAX) ? DeviceNumber.DeviceNumber : DiskNumber);
RtlInitAnsiString(&DeviceStringA, Buffer);
Status = RtlAnsiStringToUnicodeString(&DeviceStringW, &DeviceStringA, TRUE);
if (!NT_SUCCESS(Status))
@@ -686,7 +734,7 @@
for (i = 1; i <= DriveLayout->PartitionCount; i++)
{
/* Create device name */
- sprintf(Buffer, "\\Device\\Harddisk%lu\\Partition%lu", (DeviceNumber.DeviceNumber != 0xFFFFFFFF) ? DeviceNumber.DeviceNumber : DiskNumber, i);
+ sprintf(Buffer, "\\Device\\Harddisk%lu\\Partition%lu", (DeviceNumber.DeviceNumber != UINT_MAX) ? DeviceNumber.DeviceNumber : DiskNumber, i);
RtlInitAnsiString(&DeviceStringA, Buffer);
Status = RtlAnsiStringToUnicodeString(&DeviceStringW, &DeviceStringA, TRUE);
if (!NT_SUCCESS(Status))
Author: tkreuzer
Date: Tue Feb 7 13:21:04 2012
New Revision: 55481
URL: http://svn.reactos.org/svn/reactos?rev=55481&view=rev
Log:
[smmsg.h]
Fix 64 bit compilation
Modified:
trunk/reactos/include/reactos/subsys/sm/smmsg.h
Modified: trunk/reactos/include/reactos/subsys/sm/smmsg.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/sm/…
==============================================================================
--- trunk/reactos/include/reactos/subsys/sm/smmsg.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/subsys/sm/smmsg.h [iso-8859-1] Tue Feb 7 13:21:04 2012
@@ -17,7 +17,7 @@
// The exact names are not known, but we are basing them on the SmpApiName array
// in the checked build of SMSS, which is probably a close approximation. We add
// "p" to use the similar nomenclature seen/leaked out in the Base CSRSS APIs.
-//
+//
//
typedef enum _SMSRV_API_NUMBER
{
@@ -56,7 +56,9 @@
RTL_USER_PROCESS_INFORMATION ProcessInformation;
BOOLEAN DebugFlag;
} SM_EXEC_PGM_MSG, *PM_EXEC_PGM_MSG;
+#ifndef _WIN64
C_ASSERT(sizeof(SM_EXEC_PGM_MSG) == 0x48);
+#endif
typedef struct _SM_LOAD_DEFERED_SUBSYSTEM_MSG
{
@@ -101,7 +103,9 @@
//
// This is the size that Server 2003 SP1 SMSS expects, so make sure we conform.
//
+#ifndef _WIN64
C_ASSERT(sizeof(SM_API_MSG) == 0x130);
+#endif
//
// There are the APIs that the SMSS Serve can send to a client (such as CSRSS)
@@ -112,7 +116,7 @@
// array in the checked build of CSRSRV which is probably a close approximation.
// We add "p" to use the similar nomenclature seen/leaked out in the Base CSRSS
// APIs.
-//
+//
//
typedef enum _SB_API_NUMBER
{
@@ -206,8 +210,10 @@
//
// This is the size that Server 2003 SP1 SMSS expects, so make sure we conform.
//
+#ifndef _WIN64
C_ASSERT(sizeof(SB_CONNECTION_INFO) == 0xF4);
C_ASSERT(sizeof(SB_API_MSG) == 0x110);
+#endif
//
// The actual server functions that a client linking with smlib can call
@@ -228,5 +234,5 @@
IN PRTL_USER_PROCESS_INFORMATION ProcessInformation,
IN BOOLEAN DebugFlag
);
-
-#endif
+
+#endif