// ntddstor.h
// CTL_CODE(0x002d, 0x731, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_DEVICE_INTERNAL_LOG 0x002D1CC4
View the official Windows Driver Kit DDI referenceNo description available.
A driver can use IOCTL_STORAGE_GET_DEVICE_INTERNAL_LOG to get the internal status data from the device.
IRP_MJ_INTERNAL_DEVICE_CONTROL
A GET_DEVICE_INTERNAL_STATUS_DATA_REQUEST structure that identifies the type of data to be queried.
Parameters.DeviceIoControl.InputBufferLength indicates the size, in bytes, of the parameter buffer at Irp->AssociatedIrp.SystemBuffer, which must be >= sizeof(GET_DEVICE_INTERNAL_STATUS_DATA_REQUEST).
The driver returns output to the buffer at Irp->AssociatedIrp.SystemBuffer. This buffer contains a DEVICE_INTERNAL_STATUS_DATA structure with the device's internal status.
Parameters.DeviceIoControl.OutputBufferLength in the I/O stack location indicates the size, in bytes, of the parameter buffer, which must be >= sizeof(DEVICE_INTERNAL_STATUS_DATA).
n/a
n/a
Irp->IoStatus.Status is set to STATUS_SUCCESS if the request is successful. Otherwise, Status is set to the appropriate error condition as a NTSTATUS code. For more information, see NTSTATUS Values.
IOCTL_STORAGE_GET_DEVICE_INTERNAL_LOG returns the host-initiated device telemetry log from any storage device. The following pseudocode shows how to request the telemetry data header:
// 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);
GET_DEVICE_INTERNAL_STATUS_DATA_REQUEST