Esempio n. 1
0
 public static extern int DsCrackNames(
     SafeDsHandle hDS,
     DsNameFlags flags,
     DsNameFormat formatOffered,
     DsNameFormat formatDesired,
     int cNames,
     string[] rpNames,
     out IntPtr ppResult //pointer to pointer of DS_NAME_RESULT
 );
Esempio n. 2
0
 public static extern int DsCrackNames(
     SafeDsHandle hDS,
     DsNameFlags flags,
     DsNameFormat formatOffered,
     DsNameFormat formatDesired,
     int cNames,
     string[] rpNames,
     out IntPtr ppResult //pointer to pointer of DS_NAME_RESULT
     );
Esempio n. 3
0
 public static extern int DsBindWithCred(
     string DomainControllerName,
     string DnsDomainName,
     SafeDsCredentialsHandle AuthIdentity,
     out SafeDsHandle phDS
 );
Esempio n. 4
0
 public static extern int DsBind(
     string DomainControllerName,
     string DnsDomainName,
     out SafeDsHandle phDS
 );
Esempio n. 5
0
        private static DsNameResultItem[] CrackNames(
            SafeDsHandle hDS,
            DsNameFlags flags,
            DsNameFormat formatOffered,
            DsNameFormat formatDesired,
            string[] names)
        {
            PscxArgumentException.ThrowIfIsNullOrEmpty(names);

            IntPtr ptr = IntPtr.Zero;

            try
            {
                NativeMethods.EnforceSuccess(NativeMethods.DsCrackNames(
                    hDS,
                    flags,
                    formatOffered,
                    formatDesired,
                    names.Length,
                    names,
                    out ptr));

                DsNameResult result = Utils.PtrToStructure<DsNameResult>(ptr);

                IEnumerable<DsNameResultItem> items =
                    Utils.ReadNativeArray<DsNameResultItem>(result.rItems, result.cItems);

                return new List<DsNameResultItem>(items).ToArray();
            }
            finally
            {
                NativeMethods.DsFreeNameResult(ptr);
            }
        }
Esempio n. 6
0
        private static int TryBind(string server, string domain, SafeDsCredentialsHandle credentials, out SafeDsHandle handle)
        {
            if (credentials != null)
            {
                return NativeMethods.DsBindWithCred(server, domain, credentials, out handle);
            }

            return NativeMethods.DsBind(server, domain, out handle);
        }
Esempio n. 7
0
 public static extern int DsBindWithCred(
     string DomainControllerName,
     string DnsDomainName,
     SafeDsCredentialsHandle AuthIdentity,
     out SafeDsHandle phDS
     );
Esempio n. 8
0
 public static extern int DsBind(
     string DomainControllerName,
     string DnsDomainName,
     out SafeDsHandle phDS
     );