public static extern unsafe bool SetupDiGetDeviceInterfaceDetail( SafeDeviceInfoSetHandle deviceInfoSet, ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData, SP_DEVICE_INTERFACE_DETAIL_DATA *deviceInterfaceDetailData, int deviceInterfaceDetailDataSize, int *requiredSize, SP_DEVINFO_DATA *deviceInfoData);
/// <summary> /// Gets the full string pointed to by <see cref="DevicePath"/>. /// </summary> /// <param name="pSelf"> /// Note that this must be the original struct that was initialized by native memory. /// It cannot be copied first as interop will not copy any more than the first character. /// </param> /// <returns>The full string.</returns> /// <remarks> /// This is a static method rather than an instance method to try to avoid the easy /// mistake of calling the method on an instance that was copied. /// </remarks> public static string GetDevicePath(SP_DEVICE_INTERFACE_DETAIL_DATA *pSelf) { return(Marshal.PtrToStringUni(new IntPtr(pSelf->DevicePath))); }