DEVPROP_TYPE_NTSTATUS
The DEVPROP_TYPE_NTSTATUS identifier represents the base-data-type identifier for the NTSTATUS status code values that are defined in Ntstatus.h.
Remarks
In Windows Vista and later versions of Windows, the unified device property model also defines a DEVPROP_TYPE_ERROR base-data-type identifier for Microsoft Win32 error code values.
You can combine DEVPROP_TYPE_NTSTATUS 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_NTSTATUS, call the corresponding SetupDiSetXxx property function and set the function input parameters as follows:
Set the PropertyType parameter to DEVPROP_TYPE_NTSTATUS.
Set the PropertyBuffer parameter to a pointer to a buffer that can contain at least one NTSTATUS value.
Set the PropertyBufferSize parameter to sizeof(NTSTATUS).
Set the remaining function parameters as appropriate to set the property.
Retrieving the Descriptive Text for a NTSTATUS Error Code Value
To retrieve the descriptive text that is associated with an NTSTATUS error code value, call the FormatMessage function (documented in the Windows SDK) as follows:
Include a bitwise OR of the FORMAT_MESSAGE_FROM_SYSTEM flag and the FORMAT_MESSAGE_FROM_HMODULE flag in the value of the dwflags parameter.
Set the lpSource parameter to a handle to the NtDLL.dll module, which is the source for the descriptive text.
Set the dwMessageID parameter to the error code value.
Set the other options and parameters as appropriate to retrieve the descriptive text.
Requirements
Version |
Windows Vista and later versions of Windows. |
Header |
Devpropdef.h (include Devpropdef.h) |