/// <summary>Returns a <see cref="TargetDeviceDescription"/> structure containing information about the specified display target.</summary> /// <param name="targetInfo">A valid <see cref="PathTargetInfo"/> structure; must not be empty.</param> /// <returns>Returns a <see cref="TargetDeviceDescription"/> structure containing information about the specified display target.</returns> /// <exception cref="ArgumentException"/> /// <exception cref="DisplayConfigException"/> public static TargetDeviceDescription GetTargetDeviceDescription(PathTargetInfo targetInfo) { if (targetInfo == PathTargetInfo.Empty) { throw new ArgumentException("Invalid target info: empty.", "targetInfo"); } var deviceName = new TargetDeviceDescription(targetInfo.Identifier); var errorCode = SafeNativeMethods.DisplayConfigGetDeviceInfo(deviceName); if (errorCode == ErrorCode.None) { return(deviceName); } throw GetException(errorCode); }
internal static extern ErrorCode DisplayConfigGetDeviceInfo( [In, Out] TargetDeviceDescription targetDeviceInformation );