Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Structures, prefix the name with the module name and a period.
SP_DEVICE_INTERFACE_DETAIL_DATA (Structures)
.
The SP_DEVICE_INTERFACE_DETAIL_DATA structure provides detailed information about a particular device interface.
C# Definition:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)]
struct NativeDeviceInterfaceDetailData
{
public int size;
public char devicePath;
}
C# Alternative Definition:
Alternative definition:
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
struct SP_DEVICE_INTERFACE_DETAIL_DATA
{
public int cbSize;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = BUFFER_SIZE)]
public string DevicePath;
}
VB.net Definition:
<StructLayout(LayoutKind.Sequential)> _
Public Structure SP_DEVICE_INTERFACE_DETAIL_DATA
Public cbSize As UInt32
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> _
Public DevicePath As String
End Structure
Members:
size, Size of the structure, in bytes.
devicePath, NULL-terminated string that specifies the device path.
size
Size of the structure, in bytes.
devicePath
NULL-terminated string that specifies the device path.
Notes:
The cbSize parameter should be the size of the DWORD plus the first character of the string
SP_DEVICE_INTERFACE_DETAIL_DATA didd = new SP_DEVICE_INTERFACE_DETAIL_DATA();
didd.cbSize = 4 + Marshal.SystemDefaultCharSize; // trust me :)
Notes 2:
The alternative definition is not recommended. The cbSize parameter is different on various operating systems. For Win7 64bit the field must be set to value returned by
To use the structure it must be allocated on the system global heap to create space for the device path in the structure. The definition is header only which has room for null character only (text terminator).
for (;;)
{
int result = SetupDiGetDeviceInterfaceDetail(
_devInfoList, ref devIfaceData, ref *devIfaceDetailData, devIfaceDetailDataSize, out devIfaceDetailDataSize, IntPtr.Zero);
if (result == 0 && Marshal.GetLastWin32Error() != ErrorInsufficientBuffer)
throw new Win32Exception();