public static CredentialTargetInformation GetTargetInfo(string TargetName, CredGetTargetInfoFlags Flags = default) => Unmanaged.CredentialTargetInformation.GetTargetInfo(TargetName, Flags).Using(t => t.Value.ToManaged());
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; }
public static extern bool CredGetTargetInfo(string TargetName, CredGetTargetInfoFlags Flags, out IntPtr TargetInfo);