Author: hpoussin
Date: Fri Dec 14 14:32:18 2007
New Revision: 31211
URL:
http://svn.reactos.org/svn/reactos?rev=31211&view=rev
Log:
Add back support for function pointers override in HalDispatchTable structure
Fixes detection of Xbox disk partitioning
Modified:
trunk/reactos/ntoskrnl/fstub/disksup.c
trunk/reactos/ntoskrnl/fstub/halstub.c
trunk/reactos/ntoskrnl/include/internal/hal.h
Modified: trunk/reactos/ntoskrnl/fstub/disksup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fstub/disksup.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/fstub/disksup.c (original)
+++ trunk/reactos/ntoskrnl/fstub/disksup.c Fri Dec 14 14:32:18 2007
@@ -395,7 +395,8 @@
return(Status);
}
-VOID FASTCALL
+VOID
+FASTCALL
xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
IN PSTRING NtDeviceName,
OUT PUCHAR NtSystemPath,
@@ -1205,17 +1206,12 @@
return;
}
-/* PUBLIC FUNCTIONS **********************************************************/
-
-/*
- * @implemented
- */
VOID
FASTCALL
-HalExamineMBR(IN PDEVICE_OBJECT DeviceObject,
- IN ULONG SectorSize,
- IN ULONG MbrTypeIdentifier,
- OUT PVOID *MbrBuffer)
+xHalExamineMBR(IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN ULONG MbrTypeIdentifier,
+ OUT PVOID *MbrBuffer)
{
LARGE_INTEGER Offset;
PUCHAR Buffer;
@@ -1316,15 +1312,12 @@
}
}
-/*
- * @implemented
- */
NTSTATUS
FASTCALL
-IoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
- IN ULONG SectorSize,
- IN BOOLEAN ReturnRecognizedPartitions,
- IN OUT PDRIVE_LAYOUT_INFORMATION *PartitionBuffer)
+xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN BOOLEAN ReturnRecognizedPartitions,
+ IN OUT PDRIVE_LAYOUT_INFORMATION *PartitionBuffer)
{
KEVENT Event;
IO_STATUS_BLOCK IoStatusBlock;
@@ -1746,15 +1739,12 @@
return Status;
}
-/*
- * @implemented
- */
NTSTATUS
FASTCALL
-IoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject,
- IN ULONG SectorSize,
- IN ULONG PartitionNumber,
- IN ULONG PartitionType)
+xHalIoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN ULONG PartitionNumber,
+ IN ULONG PartitionType)
{
PIRP Irp;
KEVENT Event;
@@ -1937,16 +1927,13 @@
return Status;
}
-/*
- * @implemented
- */
NTSTATUS
FASTCALL
-IoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject,
- IN ULONG SectorSize,
- IN ULONG SectorsPerTrack,
- IN ULONG NumberOfHeads,
- IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer)
+xHalIoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN ULONG SectorsPerTrack,
+ IN ULONG NumberOfHeads,
+ IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer)
{
KEVENT Event;
IO_STATUS_BLOCK IoStatusBlock;
@@ -2229,6 +2216,74 @@
return Status;
}
+/* PUBLIC FUNCTIONS **********************************************************/
+
+/*
+ * @implemented
+ */
+VOID
+FASTCALL
+HalExamineMBR(IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN ULONG MbrTypeIdentifier,
+ OUT PVOID *MbrBuffer)
+{
+ HalDispatchTable.HalExamineMBR(DeviceObject,
+ SectorSize,
+ MbrTypeIdentifier,
+ MbrBuffer);
+}
+
+/*
+ * @implemented
+ */
+NTSTATUS
+FASTCALL
+IoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN BOOLEAN ReturnRecognizedPartitions,
+ IN OUT PDRIVE_LAYOUT_INFORMATION *PartitionBuffer)
+{
+ return HalIoReadPartitionTable(DeviceObject,
+ SectorSize,
+ ReturnRecognizedPartitions,
+ PartitionBuffer);
+}
+
+/*
+ * @implemented
+ */
+NTSTATUS
+FASTCALL
+IoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN ULONG PartitionNumber,
+ IN ULONG PartitionType)
+{
+ return HalIoSetPartitionInformation(DeviceObject,
+ SectorSize,
+ PartitionNumber,
+ PartitionType);
+}
+
+/*
+ * @implemented
+ */
+NTSTATUS
+FASTCALL
+IoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN ULONG SectorsPerTrack,
+ IN ULONG NumberOfHeads,
+ IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer)
+{
+ return HalIoWritePartitionTable(DeviceObject,
+ SectorSize,
+ SectorsPerTrack,
+ NumberOfHeads,
+ PartitionBuffer);
+}
+
/*
* @implemented
*/
@@ -2239,11 +2294,10 @@
OUT PUCHAR NtSystemPath,
OUT PSTRING NtSystemPathString)
{
- /* Call our deprecated function for now */
- xHalIoAssignDriveLetters(LoaderBlock,
- NtDeviceName,
- NtSystemPath,
- NtSystemPathString);
-}
+ HalIoAssignDriveLetters(LoaderBlock,
+ NtDeviceName,
+ NtSystemPath,
+ NtSystemPathString);
+}
/* EOF */
Modified: trunk/reactos/ntoskrnl/fstub/halstub.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fstub/halstub.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/fstub/halstub.c (original)
+++ trunk/reactos/ntoskrnl/fstub/halstub.c Fri Dec 14 14:32:18 2007
@@ -21,11 +21,11 @@
(pHalSetSystemInformation)NULL,
(pHalQueryBusSlots)NULL,
0,
- (pHalExamineMBR)HalExamineMBR,
- (pHalIoAssignDriveLetters)IoAssignDriveLetters,
- (pHalIoReadPartitionTable)IoReadPartitionTable,
- (pHalIoSetPartitionInformation)IoSetPartitionInformation,
- (pHalIoWritePartitionTable)IoWritePartitionTable,
+ xHalExamineMBR,
+ xHalIoAssignDriveLetters,
+ xHalIoReadPartitionTable,
+ xHalIoSetPartitionInformation,
+ xHalIoWritePartitionTable,
(pHalHandlerForBus)NULL,
(pHalReferenceBusHandler)NULL,
(pHalReferenceBusHandler)NULL,
Modified: trunk/reactos/ntoskrnl/include/internal/hal.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/hal.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/hal.h Fri Dec 14 14:32:18 2007
@@ -7,6 +7,45 @@
*/
#ifndef _HAL_
#define _HAL_
+
+//
+// Default implementations of HAL dispatch table
+//
+VOID
+FASTCALL
+xHalExamineMBR(IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN ULONG MbrTypeIdentifier,
+ OUT PVOID *MbrBuffer);
+
+VOID
+FASTCALL
+xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
+ IN PSTRING NtDeviceName,
+ OUT PUCHAR NtSystemPath,
+ OUT PSTRING NtSystemPathString);
+
+NTSTATUS
+FASTCALL
+xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN BOOLEAN ReturnRecognizedPartitions,
+ IN OUT PDRIVE_LAYOUT_INFORMATION *PartitionBuffer);
+
+NTSTATUS
+FASTCALL
+xHalIoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN ULONG PartitionNumber,
+ IN ULONG PartitionType);
+
+NTSTATUS
+FASTCALL
+xHalIoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN ULONG SectorsPerTrack,
+ IN ULONG NumberOfHeads,
+ IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer);
//
// Various offsets in the boot record