/// <summary> /// Loads this instance. /// </summary> /// <returns><c>true</c> if credential is load properly, <c>false</c> otherwise.</returns> public bool Load() { CheckNotDisposed(); UnmanagedCodePermission.Demand(); IntPtr credPointer; var result = NativeMethods.CredRead(Target, Type, 0, out credPointer); if (!result) { return(false); } using (var credentialHandle = new NativeMethods.CriticalCredentialHandle(credPointer)) { LoadInternal(credentialHandle.GetCredential()); } return(true); }
/// <summary> /// Loads this instance. /// </summary> /// <returns><c>true</c> if credential is load properly, <c>false</c> otherwise.</returns> public bool Load() { CheckNotDisposed(); UnmanagedCodePermission.Demand(); IntPtr credPointer; var result = NativeMethods.CredRead(Target, Type, 0, out credPointer); if (!result) return false; using (var credentialHandle = new NativeMethods.CriticalCredentialHandle(credPointer)) { LoadInternal(credentialHandle.GetCredential()); } return true; }