예제 #1
0
 public bool Load()
 {
     CheckNotDisposed();
     _unmanagedCodePermission.Demand();
     if (!NativeMethods.CredRead(Target, Type, 0, out IntPtr CredentialPtr))
     {
         return(false);
     }
     using (NativeMethods.CriticalCredentialHandle criticalCredentialHandle = new NativeMethods.CriticalCredentialHandle(CredentialPtr))
     {
         Loadpublic(criticalCredentialHandle.GetCredential());
     }
     return(true);
 }
예제 #2
0
        // Token: 0x06000A94 RID: 2708 RVA: 0x00021DBC File Offset: 0x0001FFBC
        public bool Load()
        {
            this.CheckNotDisposed();
            Credential._unmanagedCodePermission.Demand();
            IntPtr preexistingHandle;

            if (!NativeMethods.CredRead(this.Target, this.Type, 0, out preexistingHandle))
            {
                return(false);
            }
            using (NativeMethods.CriticalCredentialHandle criticalCredentialHandle = new NativeMethods.CriticalCredentialHandle(preexistingHandle))
            {
                this.Loadpublic(criticalCredentialHandle.GetCredential());
            }
            return(true);
        }