SetupApiSetupDiGetDeviceProperty(IntPtr, SetupApiDeviceInfo, SetupApiDevicePropertyKey, Int32, IntPtr, Int32, Int32, Int32) Method
Retrieves a device instance property.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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,
IntPtr propertyBuffer,
int propertyBufferSize,
ref int refRequiredSize,
int flags
)
<DllImportAttribute("SetupApi.dll", CharSet := CharSet.Unicode, SetLastError := true>]
Public Shared Function SetupDiGetDeviceProperty (
deviceInfoSet As IntPtr,
ByRef refDeviceInfoData As SetupApiDeviceInfo,
ByRef refPropertyKey As SetupApiDevicePropertyKey,
ByRef refPropertyType As Integer,
propertyBuffer As IntPtr,
propertyBufferSize As Integer,
ByRef refRequiredSize As Integer,
flags As Integer
) As Boolean
Dim deviceInfoSet As IntPtr
Dim refDeviceInfoData As SetupApiDeviceInfo
Dim refPropertyKey As SetupApiDevicePropertyKey
Dim refPropertyType As Integer
Dim propertyBuffer As IntPtr
Dim propertyBufferSize As Integer
Dim refRequiredSize As Integer
Dim flags As Integer
Dim returnValue As Boolean
returnValue = SetupApi.SetupDiGetDeviceProperty(deviceInfoSet,
refDeviceInfoData, refPropertyKey,
refPropertyType, propertyBuffer,
propertyBufferSize, refRequiredSize,
flags)
public:
[DllImportAttribute(L"SetupApi.dll", CharSet = CharSet::Unicode, SetLastError = true)]
static bool SetupDiGetDeviceProperty(
IntPtr deviceInfoSet,
SetupApiDeviceInfo% refDeviceInfoData,
SetupApiDevicePropertyKey% refPropertyKey,
int% refPropertyType,
IntPtr propertyBuffer,
int propertyBufferSize,
int% refRequiredSize,
int flags
)
[<DllImportAttribute("SetupApi.dll", CharSet = CharSet.Unicode, SetLastError = true)>]
static member SetupDiGetDeviceProperty :
deviceInfoSet : IntPtr *
refDeviceInfoData : SetupApiDeviceInfo byref *
refPropertyKey : SetupApiDevicePropertyKey byref *
refPropertyType : int byref *
propertyBuffer : IntPtr *
propertyBufferSize : int *
refRequiredSize : int byref *
flags : int -> bool
No code example is currently available or this language may not be supported.
- 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.
- propertyBuffer IntPtr
-
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 propertyBuffer buffer.
If propertyBuffer 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.
Boolean
Returns
if it is successful, or
otherwise.
To get extended error information, call
GetLastWin32Error.