The HalExamineMBR routine reads the master boot record (MBR) of a disk and returns data from the MBR if the MBR is of the type specified by the caller.
void HalExamineMBR( PDEVICE_OBJECT DeviceObject, ULONG SectorSize, ULONG MBRTypeIdentifier, PVOID *Buffer );
A pointer to the device object for the device being examined.
The minimum number of bytes that an I/O operation can fetch from the device being examined. If this value is less than 512, HalExamineMBR reads 512 bytes to ensure that it reads an entire partition table.
MBR partition type identifier. This parameter specifies the type of MBR that may be on the disk. For more information, see Remarks.
A pointer to a location to which HalExamineMBR writes a pointer to a buffer that contains data from the MBR. The layout of the buffer depends on the MBR partition type. HalExamineMBR allocates the storage for this buffer. The caller must deallocate this buffer as soon as possible by calling the ExFreePool routine.
HalExamineMBR sets *Buffer = NULL if the MBR partition type of the disk does not match that specified by MBRTypeIdentifier or if there is an error.
For a list of system-defined MBR partition type identifiers, see the table in PARTITION_INFORMATION. These identifiers are defined in the Ntdddisk.h header file.
|Minimum supported client||Available starting with Windows XP.|
|Header||ntddk.h (include Ntddk.h)|
|DDI compliance rules||PowerIrpDDis, HwStorPortProhibitedDDIs|