The DEVPROP_TYPE_ERROR identifier represents the base-data-type identifier for the Microsoft Win32 error code values that are defined in WINERROR.H.


In Windows Vista and later versions of Windows, the unified device property model also defines a DEVPROP_TYPE_NTSTATUS base-data-type identifier for NTSTATUS error code values.

You can combine DEVPROP_TYPE_ERROR only with the DEVPROP_TYPEMOD_ARRAY property-data-type modifier.

Setting a Property of This Type

To set a property whose base data type is DEVPROP_TYPE_ERROR, call the corresponding SetupDiSetXxx property function and set the function input parameters as follows:

  • Set the PropertyType parameter to DEVPROP_TYPE_ERROR.

  • Set the PropertyBuffer parameter to a pointer to a buffer that can contain at least one Win32 error code value.

  • Set the PropertyBufferSize parameter to sizeof(ULONG).

  • Set the remaining function parameters as appropriate to set the property.

Retrieving the Descriptive Text for a Win32 Error Code Value

To retrieve the descriptive text that is associated with a Win32 error code, call the FormatMessage function (documented in the Windows SDK) as follows:

  • Include the FORMAT_MESSAGE_FROM_SYSTEM flag in the value of the dwflags parameter.

  • Set the dwMessageID parameter to the error code value.

  • Set the other options and parameters as appropriate to retrieve the descriptive text.



Windows Vista and later versions of Windows.


Devpropdef.h (include Devpropdef.h)

See also




Send comments about this topic to Microsoft