Обработчик кстати выглядит так:
case IRP_MN_QUERY_DEVICE_RELATIONS:
{
DEVICE_RELATION_TYPE type =
irpStack->Parameters.QueryDeviceRelations.Type;
PDEVICE_RELATIONS deviceRelations = NULL;
deviceRelations = ExAllocatePoolWithTag(PagedPool, sizeof(DEVICE_RELATIONS), 'Rels');
RtlZeroMemory(deviceRelations, sizeof(DEVICE_RELATIONS));
deviceRelations->Count = 1;
deviceRelations->Objects[0] = devExt->Partition;
status = ObReferenceObjectByPointer(devExt->Partition, 0, NULL, KernelMode);
if (!NT_SUCCESS(status))
{
KdPrint(("Плохо\n"));
COMPLETE_REQUEST(Irp, status, 0);
}
else
{
KdPrint(("Хорошо\n"));
COMPLETE_REQUEST(Irp, status, (ULONG_PTR)deviceRelations);
}
break;
}