SetupApiSetupDiGetDeviceProperty(IntPtr, SetupApiDeviceInfo, SetupApiDevicePropertyKey, Int32, Guid, Int32, Int32, Int32) Method

Retrieves a device instance property.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("SetupApi.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static bool SetupDiGetDeviceProperty(
	IntPtr deviceInfoSet,
	ref SetupApiDeviceInfo refDeviceInfoData,
	ref SetupApiDevicePropertyKey refPropertyKey,
	ref int refPropertyType,
	ref Guid refPropertyBuffer,
	int propertyBufferSize,
	ref int refRequiredSize,
	int flags
)

Parameters

deviceInfoSet  IntPtr
A handle to a device information set that contains a device instance for which to retrieve a device instance property.
refDeviceInfoData  SetupApiDeviceInfo
A pointer to the SetupApiDeviceInfo structure that represents the device instance for which to retrieve a device instance property.
refPropertyKey  SetupApiDevicePropertyKey
A pointer to a SetupApiDevicePropertyKey structure that represents the device property key of the requested device instance property.
refPropertyType  Int32
A pointer to a DEVPROPTYPE-typed variable that receives the property-data-type identifier of the requested device instance property, where the property-data-type identifier is the bitwise OR between a base-data-type identifier and, if the base-data type is modified, a property-data-type modifier.
refPropertyBuffer  Guid
A pointer to a buffer that receives the requested device instance property.

SetupDiGetDeviceProperty(IntPtr, SetupApiDeviceInfo, SetupApiDevicePropertyKey, Int32, Guid, Int32, Int32, Int32) retrieves the requested property only if the buffer is large enough to hold all the property value data.

The pointer can be NULL. If the pointer is set to NULL and refRequiredSize parameter is supplied, SetupDiGetDeviceProperty(IntPtr, SetupApiDeviceInfo, SetupApiDevicePropertyKey, Int32, Guid, Int32, Int32, Int32) returns the size of the property, in bytes, in refRequiredSize parameter.

propertyBufferSize  Int32
The size, in bytes, of the refPropertyBuffer buffer.

If refPropertyBuffer parameter is set to NULL, propertyBufferSize parameter must be set to zero.

refRequiredSize  Int32
The size, in bytes, of either the device instance property if the property is retrieved or the required buffer size if the buffer is not large enough.

This pointer can be set to NULL.

flags  Int32
This parameter must be set to zero.

Return Value

Boolean
Returns if it is successful, or otherwise.

To get extended error information, call GetLastWin32Error.

Remarks

See Also