IOCTL_STORAGE_GET_DEVICE_INTERNAL_LOG IOCTL (ntddstor.h)

Um driver pode usar IOCTL_STORAGE_GET_DEVICE_INTERNAL_LOG para obter os dados internos de status do dispositivo.

Código principal

IRP_MJ_INTERNAL_DEVICE_CONTROL

Buffer de entrada

Uma estrutura GET_DEVICE_INTERNAL_STATUS_DATA_REQUEST que identifica o tipo de dados a serem consultados.

Comprimento do buffer de entrada

Parameters.DeviceIoControl.InputBufferLength indica o tamanho, em bytes, do buffer de parâmetro em Irp-AssociatedIrp.SystemBuffer>, que deve ser >= sizeof(GET_DEVICE_INTERNAL_STATUS_DATA_REQUEST).

Buffer de saída

O driver retorna a saída para o buffer em Irp-AssociatedIrp.SystemBuffer>. Esse buffer contém uma estrutura de DEVICE_INTERNAL_STATUS_DATA com a status interna do dispositivo.

Comprimento do buffer de saída

Parameters.DeviceIoControl.OutputBufferLength no local da pilha de E/S indica o tamanho, em bytes, do buffer de parâmetro, que deve ser >= sizeof(DEVICE_INTERNAL_STATUS_DATA).

Buffer de entrada/saída

n/d

Comprimento do buffer de entrada/saída

n/d

Bloco de status

Irp->IoStatus.Status será definido como STATUS_SUCCESS se a solicitação for bem-sucedida. Caso contrário, Status será definido como a condição de erro apropriada como um código NTSTATUS. Para obter mais informações, consulte Valores NTSTATUS.

Comentários

IOCTL_STORAGE_GET_DEVICE_INTERNAL_LOG retorna o log de telemetria do dispositivo iniciado pelo host de qualquer dispositivo de armazenamento. O pseudocódigo a seguir mostra como solicitar o cabeçalho de dados de telemetria:

// Allocate a GET_DEVICE_INTERNAL_STATUS_DATA_REQUEST structure, then
// initialize it with a data header request:
//   request.Version = sizeof(GET_DEVICE_INTERNAL_STATUS_DATA_REQUEST);
//   request.Size = sizeof(GET_DEVICE_INTERNAL_STATUS_DATA_REQUEST);
//   request.RequestDataType = DeviceCurrentInternalStatusDataHeader;

// Allocate a DEVICE_INTERNAL_STATUS_DATA structure in which
// to return the header data, with outputBufferLength set to
// (sizeof(DEVICE_INTERNAL_STATUS_DATA) + 512).

// Get the device internal status data.
BOOL result = TRUE;
ULONG returnedLength = 0;
result = DeviceIoControl(deviceHandle,
            IOCTL_STORAGE_GET_DEVICE_INTERNAL_LOG,
            &request,
            sizeof(GET_DEVICE_INTERNAL_STATUS_DATA_REQUEST),
            &outputBuffer,
            outputBufferLength,
            &returnedLength,
            NULL);

Requisitos

Requisito Valor
Cliente mínimo com suporte Windows 10, versão 2004
Cabeçalho ntddstor.h

Confira também

DEVICE_INTERNAL_STATUS_DATA

GET_DEVICE_INTERNAL_STATUS_DATA_REQUEST