Add back support for function pointers override in HalDispatchTable structure

Fixes detection of Xbox disk partitioning

svn path=/trunk/; revision=31211
This commit is contained in:
Hervé Poussineau 2007-12-14 11:32:18 +00:00
parent 5a3101d17b
commit 03629687b8
3 changed files with 136 additions and 43 deletions

View file

@ -395,7 +395,8 @@ xHalQueryDriveLayout(IN PUNICODE_STRING DeviceName,
return(Status);
}
VOID FASTCALL
VOID
FASTCALL
xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
IN PSTRING NtDeviceName,
OUT PUCHAR NtSystemPath,
@ -1205,14 +1206,9 @@ Cleanup:
return;
}
/* PUBLIC FUNCTIONS **********************************************************/
/*
* @implemented
*/
VOID
FASTCALL
HalExamineMBR(IN PDEVICE_OBJECT DeviceObject,
xHalExamineMBR(IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN ULONG MbrTypeIdentifier,
OUT PVOID *MbrBuffer)
@ -1316,12 +1312,9 @@ HalExamineMBR(IN PDEVICE_OBJECT DeviceObject,
}
}
/*
* @implemented
*/
NTSTATUS
FASTCALL
IoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN BOOLEAN ReturnRecognizedPartitions,
IN OUT PDRIVE_LAYOUT_INFORMATION *PartitionBuffer)
@ -1746,12 +1739,9 @@ IoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
return Status;
}
/*
* @implemented
*/
NTSTATUS
FASTCALL
IoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject,
xHalIoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN ULONG PartitionNumber,
IN ULONG PartitionType)
@ -1937,12 +1927,9 @@ IoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject,
return Status;
}
/*
* @implemented
*/
NTSTATUS
FASTCALL
IoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject,
xHalIoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN ULONG SectorsPerTrack,
IN ULONG NumberOfHeads,
@ -2229,6 +2216,74 @@ IoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject,
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,8 +2294,7 @@ IoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
OUT PUCHAR NtSystemPath,
OUT PSTRING NtSystemPathString)
{
/* Call our deprecated function for now */
xHalIoAssignDriveLetters(LoaderBlock,
HalIoAssignDriveLetters(LoaderBlock,
NtDeviceName,
NtSystemPath,
NtSystemPathString);

View file

@ -21,11 +21,11 @@ HAL_DISPATCH HalDispatchTable =
(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,

View file

@ -8,6 +8,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
//