public static string GetSourceGDIDeviceName(PathSourceInfo sourceInfo) { if (sourceInfo == PathSourceInfo.Empty) { throw new ArgumentException("Invalid source info: empty.", "sourceInfo"); } var deviceName = new SourceDeviceName(sourceInfo.Identifier); var errorCode = SafeNativeMethods.DisplayConfigGetDeviceInfo(deviceName); if (errorCode == ErrorCode.None) { return(deviceName.GDIDeviceName.TrimEnd('\0')); } throw GetException(errorCode); }
internal static extern ErrorCode DisplayConfigGetDeviceInfo( [In, Out] SourceDeviceName sourceDeviceInformation );