Пример #1
0
        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);
        }
Пример #2
0
 internal static extern ErrorCode DisplayConfigGetDeviceInfo(
     [In, Out] SourceDeviceName sourceDeviceInformation
     );