コード例 #1
0
 public static CredentialTargetInformation GetTargetInfo(string TargetName, CredGetTargetInfoFlags Flags = default)
 => Unmanaged.CredentialTargetInformation.GetTargetInfo(TargetName, Flags).Using(t => t.Value.ToManaged());
コード例 #2
0
        public static IDisposableGetter <CredentialTargetInformation> GetTargetInfo(string TargetName, CredGetTargetInfoFlags Flags = default)
        {
            if (Interop.CredGetTargetInfo(TargetName, Flags, out var TargetInfo))
            {
                return(new CriticalCredGetterHandle <CredentialTargetInformation>(TargetInfo, From));
            }
            var hresult   = Marshal.GetHRForLastWin32Error();
            var exception = Marshal.GetExceptionForHR(hresult);

            if (unchecked ((uint)hresult) == 0x80070032)
            {
                throw new NotSupportedException("not support.", exception);
            }
            throw exception;
        }
コード例 #3
0
 public static extern bool CredGetTargetInfo(string TargetName, CredGetTargetInfoFlags Flags, out IntPtr TargetInfo);