HalExamineMBR

VOID
HalExamineMBR(

IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN ULONG MBRTypeIdentifier,
OUT PVOID Buffer,
);

HalExamineMBR 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.

Parameters

DeviceObject

Points to the device object for the device being examined.

SectorSize

Specifies 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.

MBRTypeIdentifier

Specifies the type of MBR that may be on the disk.

Buffer

Points to a buffer that returns data from the MBR. The layout of the buffer depends on the MBRTypeIdentifier. The caller must deallocate this buffer as soon as possible with ExFreePool. This routine returns NULL in Buffer if the MBRTypeIdentifier of the disk does not match that specified by the caller or if there is an error.

Comments

Callers of HalExamineMBR must be running at IRQL PASSIVE_LEVEL.

See Also

ExFreePool