IoGetDevicePropertyData function

The IoGetDevicePropertyData routine retrieves the current setting for a device property.

Syntax

NTSTATUS IoGetDevicePropertyData(
  PDEVICE_OBJECT   Pdo,
  const DEVPROPKEY *PropertyKey,
  LCID             Lcid,
  ULONG            Flags,
  ULONG            Size,
  PVOID            Data,
  PULONG           RequiredSize,
  PDEVPROPTYPE     Type
);

Parameters

Pdo

A pointer to the physical device object (PDO) for the device that is being queried.

PropertyKey

A pointer to a DEVPROPKEY structure that specifies the device property key.

Lcid

A locale identifier. Set this parameter either to a language-specific LCID value or to LOCALE_NEUTRAL. The LOCALE_NEUTRAL LCID specifies that the property is language-neutral (that is, not specific to any language). Do not set this parameter to LOCALE_SYSTEM_DEFAULT or LOCALE_USER_DEFAULT. For more information about language-specific LCID values, see LCID Structure.

Flags

Reserved for system use. Drivers should set this value to 0.

Size

The size, in bytes, of the buffer that Data points to.

Data

A pointer to the device property data.

RequiredSize

A pointer to a ULONG to receive the size of the property information that is returned at Data. If IoGetDevicePropertyData returns STATUS_BUFFER_TOO_SMALL, the caller can use this value to allocate a buffer of the correct size.

Type

A pointer to a DEVPROPTYPE value. If IoGetDevicePropertyData completes successfully, the routine uses Type to supply the type of data that is returned in the Data buffer.

Return Value

IoGetDevicePropertyData returns an NTSTATUS value. This routine might return one of the following values:

Return code Description
STATUS_SUCCESS
The operation succeeded. The Data buffer contains the retrieved data. *Type contains the type of the retrieved data.
STATUS_BUFFER_TOO_SMALL
The Data buffer is too small. *RequiredSize contains the required buffer length.
STATUS_OBJECT_NAME_NOT_FOUND
The specified device property was not found.

Remarks

Kernel-mode drivers use the IoGetDevicePropertyData routine to retrieve device properties that are defined as part of the unified device property model.

To see property types available for use by this routine, see DEVPROP_TYPE_BYTE and adjacent pages for DEVPROP_TYPE_*.

Drivers can use the IoSetDevicePropertyData routine to modify a device property.

Callers of IoGetDevicePropertyData must be running at IRQL <= APC_LEVEL in the context of a system thread.

Requirements

   
Minimum supported client Available starting with Windows Vista.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL <= APC_LEVEL
DDI compliance rules PowerIrpDDis, HwStorPortProhibitedDDIs

See Also

DEVPROPKEY

DEVPROPTYPE

IoSetDevicePropertyData